GitHub user remibergsma opened a pull request:

    https://github.com/apache/cloudstack/pull/1249

    CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh

    Added quotes to prevent syntax errors in weird situations.
    
    Error seen in mgt server:
    ```
    2015-12-15 14:30:32,371 DEBUG [c.c.a.m.AgentManagerImpl] 
(RedundantRouterStatusMonitor-7:ctx-0dd8ef3e) Details from executing class 
com.cloud.agent.api.CheckRouterCommand: Status: UNKNOWN
    /opt/cloud/bin/checkrouter.sh: line 28: [: =: unary operator expected
    /opt/cloud/bin/checkrouter.sh: line 31: [: =: unary operator expected
    ```
    Cause:
    ```
    root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh
    ./checkrouter.sh: line 28: [: =: unary operator expected
    ./checkrouter.sh: line 31: [: =: unary operator expected
    Status: UNKNOWN
    ```
    
    Somehow a nic was missing.
    
    After fix the script can handle this:
    
    ```
    root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh
    Status: UNKNOWN
    ```
    
    The other states are also reported fine:
    ```
    root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh
    Status: MASTER
    ```
    
    ```
    root@r-1192-VM:/opt/cloud/bin# ./checkrouter.sh
    Status: BACKUP
    ```


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/remibergsma/cloudstack fix-checkrouter-script

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1249.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1249
    
----
commit b7785fc70e95d8da5936fcad34de026d1d04982a
Author: Remi Bergsma <git...@remi.nl>
Date:   2015-12-16T10:27:26Z

    CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to