# the set of valid node run states
-NodeRunStates = {'new':None,
- 'inst':None,
- 'rins':None,
- 'boot':None,
- 'dbg':None}
+NodeRunStates = {}
class log:
def main(argv):
global NodeRunStates
- # set to 0 if no error occurred
- error= 1
+ NodeRunStates = {'new':None,
+ 'inst':None,
+ 'rins':None,
+ 'boot':None,
+ 'dbg':None}
+
+ # set to 1 if error occurred
+ error= 0
# all output goes through this class so we can save it and post
# the data back to PlanetLab central
fState = argv[1]
if NodeRunStates.has_key(fState):
forceState = fState
- error = 0
else:
LOG.LogEntry("FATAL: cannot force node run state to=%s" % fState)
+ error = 1
except:
traceback.print_exc(file=LOG.OutputFile)
traceback.print_exc()
strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) )
LOG.Upload()
return error
- else:
- error = 1
try:
bm= BootManager(LOG,forceState)
success= bm.Run()
if success:
LOG.LogEntry( "\nDone!" );
- error = 0
else:
LOG.LogEntry( "\nError occurred!" );
+ error = 1
except:
traceback.print_exc(file=LOG.OutputFile)
traceback.print_exc()