Bug 798867 - Logic error in send_stopped_status function in node/cartridges/abstract/info/lib/util
Logic error in send_stopped_status function in node/cartridges/abstract/info/...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
1.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Dan McPherson
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-01 01:38 EST by Johnny Liu
Modified: 2012-03-02 16:56 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-02 16:56:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Johnny Liu 2012-03-01 01:38:38 EST
Description of problem:
In node/cartridges/abstract/info/lib/util:

function send_stopped_status {
    _state=`get_app_state`

    case "$_state" in
      idle)     send_attr "status=ALREADY_IDLED" ;;
      stopped)  send_attr "status=ALREADY_STOPPED" ;;
      *)
          if [ -f $APP_DIR/run/stop_lock ]
          then
              send_attr "status=ALREADY_IDLED"
          else
              HTTP_DIR=`dirname "/etc/httpd/conf.d/libra/${uuid}"*/00000_default.conf`
              if [ -f $HTTP_DIR/0000000000000_disabled.conf ]
              then
                  send_attr "status=ALREADY_IDLED"
              else
                  send_attr "status=ALREADY_STOPPED"
              fi
          fi
          ;;
    esac
}

For *) branch, if $APP_DIR/run/stop_lock file exists, this app maybe stopped or idled, it is not necessarily "status=ALREADY_IDLED", need do more test

What about this:
      *)
          if [ -f $APP_DIR/run/stop_lock ]
          then
              HTTP_DIR=`dirname "/etc/httpd/conf.d/libra/${uuid}"*/00000_default.conf`
              if [ -f $HTTP_DIR/0000000000000_disabled.conf ]
              then
                  send_attr "status=ALREADY_IDLED"
              else
                  send_attr "status=ALREADY_STOPPED"
              fi
          fi


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Dan McPherson 2012-03-01 10:13:49 EST
Fixed for stage.
Comment 2 Johnny Liu 2012-03-01 21:17:04 EST
Verified this bug with rhc-node-0.87.9-1, and PASS

Note You need to log in before you can comment on or make changes to this bug.