from pcucontrol import reboot
from monitor import config
from monitor.database.info.model import FindbadPCURecordSync, FindbadPCURecord, session
+from monitor import database
from monitor import util
from monitor.wrapper import plc, plccache
from nodequery import pcu_select
fbnodesync.flush()
node_round = fbnodesync.round
- if node_round < global_round:
+ if node_round < global_round or config.force:
# recreate node stats when refreshed
#print "%s" % nodename
req = threadpool.WorkRequest(collectPingAndSSH, [pcuname, cohash], {},
global_round = fbsync.round
- if config.increment:
- # update global round number to force refreshes across all nodes
- global_round += 1
- fbsync.round = global_round
-
- fbsync.flush()
if config.site is not None:
api = plc.getAuthAPI()
l_pcus = [pcu for pcu in sets.Set(pcus)]
elif config.pcuselect is not None:
n, pcus = pcu_select(config.pcuselect)
+ print pcus
# clear out dups.
l_pcus = [pcu for pcu in sets.Set(pcus)]
l_pcus = [ config.pcuid ]
l_pcus = [int(pcu) for pcu in l_pcus]
+ if config.increment:
+ # update global round number to force refreshes across all nodes
+ global_round += 1
+ fbsync.round = global_round
+ fbsync.flush()
+
checkAndRecordState(l_pcus, cohash)
return 0
dbname="findbadpcus",
cachenodes=False,
refresh=False,
+ force=False,
)
parser.add_option("-f", "--nodelist", dest="nodelist", metavar="FILE",
help="Provide the input file for the node list")
help="Refresh the cached values")
parser.add_option("-i", "--increment", action="store_true", dest="increment",
help="Increment round number to force refresh or retry")
+ parser.add_option("", "--force", action="store_true", dest="force",
+ help="Force probe without incrementing global 'round'.")
parser = parsermodule.getParser(['defaults'], parser)
config = parsermodule.parse_args(parser)
try: