summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-10-08 20:22:41 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-10-08 20:22:41 +0000
commit26f2687927ed180c82ed0d60ce5fb8fa90be65d0 (patch)
tree6896e09393edfc8066ed6159436d6ca73b1cda1b /src/lib/Client
parentfde846836107c325bcaa055cfe2545d35827d897 (diff)
downloadbcfg2-26f2687927ed180c82ed0d60ce5fb8fa90be65d0.tar.gz
bcfg2-26f2687927ed180c82ed0d60ce5fb8fa90be65d0.tar.bz2
bcfg2-26f2687927ed180c82ed0d60ce5fb8fa90be65d0.zip
Implement the balance of decision mode support (tested and working)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4933 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Frame.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index a2312e495..6d778f6ba 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -28,14 +28,14 @@ def promptFilter(prompt, entries):
return ret
def matches_white_list(entry, whitelist):
- return (entry.tag, entry.get('name')) in whitelist or \
- (entry.tag, '*') in whitelist or \
- ('*', entry.get('name')) in whitelist
+ return [entry.tag, entry.get('name')] in whitelist or \
+ [entry.tag, '*'] in whitelist or \
+ ['*', entry.get('name')] in whitelist
def passes_black_list(entry, blacklist):
- return (entry.tag, entry.get('name')) not in blacklist and \
- and (entry.tag, '*') not in blacklist and \
- ('*', entry.get('name')) not in blacklist
+ return [entry.tag, entry.get('name')] not in blacklist and \
+ [entry.tag, '*'] not in blacklist and \
+ ['*', entry.get('name')] not in blacklist
class Frame:
'''Frame is the container for all Tool objects and state information'''
@@ -167,6 +167,7 @@ class Frame:
self.logger.info("In whitelist mode: suppressing installation of:")
self.logger.info(["%s:%s" % (e.tag, e.get('name')) for e in w_to_rem])
self.whitelist = [x for x in self.whitelist if x not in w_to_rem]
+
elif self.setup['decision'] == 'blacklist':
b_to_rem = [e for e in self.whitelist \
if not passes_black_list(e, self.setup['decision_list'])]