summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Frame.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-09-24 01:41:41 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-09-24 01:41:41 +0000
commit3b3a1333d9db9185e62df5b8275836bbbb23a937 (patch)
treebe798b8393217a4de3db26fd720d76e86ae28382 /src/lib/Client/Frame.py
parent78c67fca3ca6c9973d7ada5cd0d9ccf7c6d55f18 (diff)
downloadbcfg2-3b3a1333d9db9185e62df5b8275836bbbb23a937.tar.gz
bcfg2-3b3a1333d9db9185e62df5b8275836bbbb23a937.tar.bz2
bcfg2-3b3a1333d9db9185e62df5b8275836bbbb23a937.zip
Implement client side of server-delegated decision support
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4919 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Frame.py')
-rw-r--r--src/lib/Client/Frame.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index a54760b12..009ee61ec 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -148,6 +148,20 @@ class Frame:
candidates = [entry for entry in self.states if not self.states[entry]]
self.whitelist = [entry for entry in self.states if not self.states[entry]]
+ # Need to process decision stuff early, so that dryrun mode works with it
+ if self.setup['decision'] == 'whitelist':
+ dwl = self.setup['decision_list'][0]
+ self.whitelist = [e for e in self.whitelist \
+ if (e.tag, e.get('name')) in dwl or \
+ (e.tag, '*') in dwl or \
+ ('*', e.get('name')) in dwl]
+ elif self.setup['decision'] == 'blacklist':
+ dbl = self.setup['decision_list'][1]
+ self.whitelist = [e for e in self.whitelist \
+ if (e.tag, e.get('name')) not in dbl and \
+ (e.tag, '*') not in dbl and \
+ ('*', e.get('name')) not in dbl]
+
if self.dryrun:
if self.whitelist:
self.logger.info("In dryrun mode: suppressing entry installation for:")