X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=commands%2Fpcubad.py;fp=commands%2Fpcubad.py;h=6db09f39c306c6429c069a692241316bb212e404;hp=085389faa8a794b520c8c7818e5dda1937a2f8a0;hb=ce93165cb28465c327cf51ab736ac35c88e15c26;hpb=09a4319e30f5fadf17cbc5fbbef03bb2a35c5f0f diff --git a/commands/pcubad.py b/commands/pcubad.py index 085389f..6db09f3 100755 --- a/commands/pcubad.py +++ b/commands/pcubad.py @@ -63,15 +63,17 @@ hn2lb = plccache.plcdb_hn2lb def check_pcu_state(rec, pcu): pcu_state = rec.reboot_trial_status + print pcu_state + good_list = [0, "0", "Test: No error"] # DOWN - if pcu_state not in [0, "0"] and pcu.status not in ['offline', 'down']: + if pcu_state not in good_list and pcu.status not in ['offline', 'down']: print "changed status from %s to offline" % pcu.status pcu.status = 'offline' pcu.last_changed = datetime.now() # ONLINE - if pcu_state in [0, "0"] and pcu.status not in [ 'online', 'good' ]: + if pcu_state in good_list and pcu.status not in [ 'online', 'good' ]: print "changed status from %s to online" % pcu.status pcu.status = 'online' pcu.last_changed = datetime.now()