From 9707537bb7184a9109a7595459b4c4e84ef5b4f3 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 16 Jan 2008 03:52:41 +0000 Subject: Implement support for -b foo:bar:baz on the command line (Resolves Ticket #516) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4244 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Frame.py | 2 +- src/lib/Options.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py index b341d65fd..d0477f752 100644 --- a/src/lib/Client/Frame.py +++ b/src/lib/Client/Frame.py @@ -170,7 +170,7 @@ class Frame: # first perform bundle filtering if self.setup['bundle']: bundles = [b for b in self.config.findall('./Bundle') \ - if b.get('name') == self.setup['bundle']] + if b.get('name') in self.setup['bundle']] self.whitelist = [e for e in self.whitelist if \ True in [e in b for b in bundles]] else: diff --git a/src/lib/Options.py b/src/lib/Options.py index d797fdc9c..17c13c09b 100644 --- a/src/lib/Options.py +++ b/src/lib/Options.py @@ -128,6 +128,7 @@ class OptionSet(dict): self[key] = val list_split = lambda x:x.replace(' ','').split(',') +colon_split = lambda x:x.split(':') CFILE = Option('Specify configuration file', DEFAULT_CONFIG_LOCATION, cmd='-C', odesc='') @@ -182,7 +183,7 @@ CLIENT_CACHE = Option('store the configuration in a file', CLIENT_REMOVE = Option('force removal of additional configuration items', default=False, cmd='-r', odesc="") CLIENT_BUNDLE = Option('only configure the given bundle', default=False, - cmd='-b', odesc='') + cmd='-b', odesc='', cook=colon_split) CLIENT_KEVLAR = Option('run in kevlar (bulletproof) mode', default=False, cmd='-k', ) CLIENT_BUILD = Option('run in build mode', default=False, cmd='-B', ) -- cgit v1.2.3-1-g7c22