summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Frame.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Client/Frame.py')
-rw-r--r--src/lib/Bcfg2/Client/Frame.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py
index ad718749e..d7d64d472 100644
--- a/src/lib/Bcfg2/Client/Frame.py
+++ b/src/lib/Bcfg2/Client/Frame.py
@@ -171,15 +171,8 @@ class Frame(object):
return self.__dict__[name]
raise AttributeError(name)
- def InstallImportant(self):
- """Install important entries
-
- We also process the decision mode stuff here because we want to prevent
- non-whitelisted/blacklisted 'important' entries from being installed
- prior to determining the decision mode on the client.
- """
- # Need to process decision stuff early so that dryrun mode
- # works with it
+ def GenerateActions(self):
+ """Generate list of all entries that have to be handled"""
self.whitelist = [entry for entry in self.states
if not self.states[entry]]
if not self.setup['file']:
@@ -206,6 +199,17 @@ class Frame(object):
self.whitelist = [x for x in self.whitelist
if x not in b_to_rem]
+ def InstallImportant(self):
+ """Install important entries
+
+ We also process the decision mode stuff here because we want to prevent
+ non-whitelisted/blacklisted 'important' entries from being installed
+ prior to determining the decision mode on the client.
+ """
+ # Need to process decision stuff early so that dryrun mode
+ # works with it
+ self.GenerateActions()
+
# take care of important entries first
if not self.dryrun:
parent_map = dict((c, p)
@@ -489,6 +493,9 @@ class Frame(object):
self.CondDisplayState('initial')
self.InstallImportant()
self.Decide()
+ if self.modified:
+ self.Inventory()
+ self.GenerateActions()
self.Install()
self.times['install'] = time.time()
self.Remove()
@@ -517,7 +524,9 @@ class Frame(object):
stats.set('state', 'clean')
# List bad elements of the configuration
- for (data, ename) in [(self.modified, 'Modified'),
+ mods = [m for m in self.modified
+ if (m.tag != 'Action' or m.get('when') != 'always')]
+ for (data, ename) in [(mods, 'Modified'),
(self.extra, "Extra"),
(good_entries, "Good"),
([entry for entry in self.states