diff options
author | sienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2012-01-18 17:36:05 -0500 |
---|---|---|
committer | sienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2012-01-18 17:36:05 -0500 |
commit | a5afe5f657f5812ea95c5eb476eb355de6afa5a9 (patch) | |
tree | f14049a9056e660abf736073ae14a7221011fca0 /steuermann/run.py | |
parent | c7082d39ae1f653fc33383d9e093d54b00022fd5 (diff) | |
download | steuermann-a5afe5f657f5812ea95c5eb476eb355de6afa5a9.tar.gz |
new sm files for nightly builds
IMPORT feature in specification language
checkpointing of various uncommitted changes
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@538 d34015c8-bcbb-4646-8ac8-8ba5febf221d
Diffstat (limited to 'steuermann/run.py')
-rw-r--r-- | steuermann/run.py | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/steuermann/run.py b/steuermann/run.py index 388b366..77db2f1 100644 --- a/steuermann/run.py +++ b/steuermann/run.py @@ -29,9 +29,14 @@ import os.path import traceback import sys import errno - import ConfigParser +def config_yes_no(d,which) : + if not which in d : + return False + s = d[which] + return s.strip()[0].lower() in ( 'y', 't', '1' ) + debug=0 ##### @@ -73,8 +78,15 @@ class runner(object): # start a process def run( self, node, run_name, logfile_name, no_run = False ): + '''run a process + return is: + D - host disabled + M - not run max proc limit + R - running +''' try : + try : args = self.get_host_info(node.host) except Exception, e : @@ -83,13 +95,16 @@ class runner(object): print e raise + if ( config_yes_no(args,'disable') ) : + return 'D' + hostname = args['hostname'] if 'maxproc' in args : n = int(self.howmany.get(hostname,0)) if n >= int(args['maxproc']) : # print "decline to run %s - %d other already running"%(node.name,n) - return False + return 'M' n = n + 1 self.howmany[hostname] = n @@ -154,8 +169,9 @@ class runner(object): logfile.flush() # debug - just say the name of the node we would run - if no_run : - run = [ 'echo', 'no_run - node=', node.name ] + + if ( no_run ) : + run = [ 'echo', 'disable run - node=', node.name ] # start running the process if debug : @@ -174,7 +190,7 @@ class runner(object): # remember the process is running self.all_procs[node.name] = n - return True + return 'R' except Exception, e : log_traceback() |