Bug 798867 - Logic error in send_stopped_status function in node/cartridges/abstract/info/lib/util
Summary: Logic error in send_stopped_status function in node/cartridges/abstract/info/...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 1.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Dan McPherson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-01 06:38 UTC by Johnny Liu
Modified: 2012-03-02 21:56 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-02 21:56:37 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Johnny Liu 2012-03-01 06:38:38 UTC
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 15:13:49 UTC
Fixed for stage.

Comment 2 Johnny Liu 2012-03-02 02:17:04 UTC
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.