git://git.onelab.eu
/
monitor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- fix UP/DOWN summary on nodes page.
[monitor.git]
/
nodebad.py
diff --git
a/nodebad.py
b/nodebad.py
index
acd5007
..
dc86664
100755
(executable)
--- a/
nodebad.py
+++ b/
nodebad.py
@@
-6,7
+6,7
@@
import string
import time
from datetime import datetime,timedelta
import time
from datetime import datetime,timedelta
-from
node
query import verify,query_to_dict,node_select
+from
monitor.
query import verify,query_to_dict,node_select
from monitor.common import *
from monitor.common import *
@@
-79,15
+79,19
@@
def check_node_state(rec, node):
print "changed status from %s to offline" % node.status
node.status = 'offline'
node.last_changed = datetime.now()
print "changed status from %s to offline" % node.status
node.status = 'offline'
node.last_changed = datetime.now()
-
- if node_state == 'DEBUG'
and node.status not in ['failboot', 'disabled', 'safeboot']
:
+
+ if node_state == 'DEBUG':
if boot_state != 'disabled' and boot_state != 'safeboot':
print "changed status from %s to failboot" % (node.status)
if boot_state != 'disabled' and boot_state != 'safeboot':
print "changed status from %s to failboot" % (node.status)
- node.status = "failboot"
- node.last_changed = datetime.now()
+ current_status = "failboot"
else:
print "changed status from %s to %s" % (node.status, boot_state)
else:
print "changed status from %s to %s" % (node.status, boot_state)
- node.status = boot_state
+ current_status = boot_state
+
+ if current_status != node.status and \
+ current_status in ['failboot', 'disabled', 'safeboot']:
+
+ node.status = current_status
node.last_changed = datetime.now()
if node_state == 'BOOT' and node.status != 'online' and node.status != 'good':
node.last_changed = datetime.now()
if node_state == 'BOOT' and node.status != 'online' and node.status != 'good':