git://git.onelab.eu
/
bootmanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb5fbc8
)
Cleaned up NodeRunStates handling
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Thu, 13 Jul 2006 19:50:43 +0000
(19:50 +0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Thu, 13 Jul 2006 19:50:43 +0000
(19:50 +0000)
source/BootManager.py
patch
|
blob
|
history
diff --git
a/source/BootManager.py
b/source/BootManager.py
index
9df68db
..
5519af4
100755
(executable)
--- a/
source/BootManager.py
+++ b/
source/BootManager.py
@@
-75,11
+75,7
@@
BIN_PATH= ('/usr/local/bin',
# the set of valid node run states
# the set of valid node run states
-NodeRunStates = {'new':None,
- 'inst':None,
- 'rins':None,
- 'boot':None,
- 'dbg':None}
+NodeRunStates = {}
class log:
class log:
@@
-348,8
+344,14
@@
class BootManager:
def main(argv):
global NodeRunStates
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
# all output goes through this class so we can save it and post
# the data back to PlanetLab central
@@
-364,9
+366,9
@@
def main(argv):
fState = argv[1]
if NodeRunStates.has_key(fState):
forceState = fState
fState = argv[1]
if NodeRunStates.has_key(fState):
forceState = fState
- error = 0
else:
LOG.LogEntry("FATAL: cannot force node run state to=%s" % fState)
else:
LOG.LogEntry("FATAL: cannot force node run state to=%s" % fState)
+ error = 1
except:
traceback.print_exc(file=LOG.OutputFile)
traceback.print_exc()
except:
traceback.print_exc(file=LOG.OutputFile)
traceback.print_exc()
@@
-376,8
+378,6
@@
def main(argv):
strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) )
LOG.Upload()
return error
strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) )
LOG.Upload()
return error
- else:
- error = 1
try:
bm= BootManager(LOG,forceState)
try:
bm= BootManager(LOG,forceState)
@@
-389,9
+389,9
@@
def main(argv):
success= bm.Run()
if success:
LOG.LogEntry( "\nDone!" );
success= bm.Run()
if success:
LOG.LogEntry( "\nDone!" );
- error = 0
else:
LOG.LogEntry( "\nError occurred!" );
else:
LOG.LogEntry( "\nError occurred!" );
+ error = 1
except:
traceback.print_exc(file=LOG.OutputFile)
traceback.print_exc()
except:
traceback.print_exc(file=LOG.OutputFile)
traceback.print_exc()