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
added blacklist to action.py
[monitor.git]
/
sitebad.py
diff --git
a/sitebad.py
b/sitebad.py
index
a0407c9
..
6d3c042
100755
(executable)
--- a/
sitebad.py
+++ b/
sitebad.py
@@
-37,11
+37,15
@@
def main2(config):
checkAndRecordState(l_sites, l_plcsites)
def getnodesup(nodelist):
checkAndRecordState(l_sites, l_plcsites)
def getnodesup(nodelist):
+ # NOTE : assume that a blacklisted node is fine, since we're told not to
+ # ignore it, no policy actions should be taken for it.
up = 0
for node in nodelist:
try:
nodehist = HistoryNodeRecord.findby_or_create(hostname=node['hostname'])
up = 0
for node in nodelist:
try:
nodehist = HistoryNodeRecord.findby_or_create(hostname=node['hostname'])
- if nodehist is not None and nodehist.status != 'down':
+ nodebl = BlacklistRecord.get_by(hostname=node['hostname'])
+ if (nodehist is not None and nodehist.status != 'down') or \
+ (nodebl is not None and not nodebl.expired():
up = up + 1
except:
import traceback
up = up + 1
except:
import traceback