diff options
author | cslocum <cslocum@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2012-11-07 10:55:30 -0500 |
---|---|---|
committer | cslocum <cslocum@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2012-11-07 10:55:30 -0500 |
commit | 0eccf18e674d623e28e9d61b1a73799316ed1083 (patch) | |
tree | 6a718b28c593ac8cce412783d0adb72954b4aa2e /steuermann/run.py | |
parent | b63cde4fd3eb66ab9a707dcadfe964e135f1f594 (diff) | |
download | steuermann-0eccf18e674d623e28e9d61b1a73799316ed1083.tar.gz |
added feature: can pass -h <hosts_ini_file> to smc to specify which .ini file to load hosts info from
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@833 d34015c8-bcbb-4646-8ac8-8ba5febf221d
Diffstat (limited to 'steuermann/run.py')
-rw-r--r-- | steuermann/run.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/steuermann/run.py b/steuermann/run.py index 73e9409..3b098da 100644 --- a/steuermann/run.py +++ b/steuermann/run.py @@ -68,10 +68,10 @@ class runner(object): ##### # - def __init__( self, nodes ) : + def __init__( self, nodes, hosts_ini ) : self.all_procs = { } self.node_index = nodes - self.load_host_info() + self.load_host_info(filename = hosts_ini) self.host_info_cache = { } self.howmany = { } @@ -293,14 +293,20 @@ class runner(object): print "No config section in hosts.ini: %s"%section return { } - def load_host_info( self, filename=None ) : + + def load_host_info( self, filename ) : + + if os.path.exists(filename): + print 'READING HOST INFO FROM %s' %filename + else: + print 'ERROR - %s does not exist' %filename + sys.exit(1) # read the config file - if filename is None : - filename = os.path.dirname(__file__) + '/hosts.ini' self.cfg = ConfigParser.RawConfigParser() self.cfg.read(filename) + def get_host_info(self, host) : if not host in self.host_info_cache : d = self._host_get_names(self.cfg, host) |