diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-06-03 13:28:46 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-06-03 13:28:46 -0500 |
commit | 5a31e049ee342ec5874447796bc3978310306afb (patch) | |
tree | 08368920ee86ca447a0763dbd54ad0d5b45c7735 /src/lib/Options.py | |
parent | 623ef741053c9c213b526787a0631c71b90df186 (diff) | |
download | bcfg2-5a31e049ee342ec5874447796bc3978310306afb.tar.gz bcfg2-5a31e049ee342ec5874447796bc3978310306afb.tar.bz2 bcfg2-5a31e049ee342ec5874447796bc3978310306afb.zip |
bcfg2-server: Add the ability to listen on specific interfaces (#1013)
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Options.py')
-rw-r--r-- | src/lib/Options.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/Options.py b/src/lib/Options.py index e6eebb808..9980566fb 100644 --- a/src/lib/Options.py +++ b/src/lib/Options.py @@ -173,6 +173,18 @@ def colon_split(c_string): return c_string.split(':') return [] +def get_bool(s): + # these values copied from ConfigParser.RawConfigParser.getboolean + # with the addition of True and False + truelist = ["1", "yes", "True", "true", "on"] + falselist = ["0", "no", "False", "false", "off"] + if s in truelist: + return True + elif s in falselist: + return False + else: + raise ValueError + # General options CFILE = Option('Specify configuration file', DEFAULT_CONFIG_LOCATION, cmd='-C', odesc='<conffile>') @@ -249,6 +261,13 @@ SERVER_MCONNECT = Option('Server Metadata Connector list', cook=list_split, cf=('server', 'connectors'), default=['Probes'], ) SERVER_FILEMONITOR = Option('Server file monitor', cf=('server', 'filemonitor'), default='default', odesc='File monitoring driver') +SERVER_LISTEN_ALL = Option('Listen on all interfaces', + cf=('server', 'listen_all'), + cmd='--listen-all', + default=False, + long_arg=True, + cook=get_bool, + odesc='True|False') SERVER_LOCATION = Option('Server Location', cf=('components', 'bcfg2'), default='https://localhost:6789', cmd='-S', odesc='https://server:port') |