diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-08-22 18:19:31 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-08-22 18:19:31 +0000 |
commit | 44261731d59240dedacfa691e7fe52ca4d65a533 (patch) | |
tree | 29333dcb104c11db0912f8a4ab36cede0c376edb | |
parent | 764100713792f761091870a17d914a27e59a5d20 (diff) | |
download | bcfg2-44261731d59240dedacfa691e7fe52ca4d65a533.tar.gz bcfg2-44261731d59240dedacfa691e7fe52ca4d65a533.tar.bz2 bcfg2-44261731d59240dedacfa691e7fe52ca4d65a533.zip |
Make the Proxy library respect the -C option (Resolves Ticket #94)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2084 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Client/Proxy.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/Client/Proxy.py b/src/lib/Client/Proxy.py index 17a1b0ff2..304d6bc3a 100644 --- a/src/lib/Client/Proxy.py +++ b/src/lib/Client/Proxy.py @@ -1,7 +1,7 @@ '''Cobalt proxy provides client access to cobalt components''' __revision__ = '$Revision$' -import logging, socket, time, xmlrpclib, ConfigParser, httplib +import logging, socket, sys, time, xmlrpclib, ConfigParser, httplib class CobaltComponentError(Exception): '''This error signals component connection errors''' @@ -123,7 +123,10 @@ class OSSafeTransport(xmlrpclib.Transport): class SafeProxy: '''Wrapper for proxy''' _cfile = ConfigParser.ConfigParser() - _cfpath = '/etc/bcfg2.conf' + if '-C' in sys.argv: + _cfpath = sys.argv[sys.argv.index('-C') + 1] + else: + _cfpath = '/etc/bcfg2.conf' _cfile.read([_cfpath]) try: _components = _cfile._sections['components'] |