summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-01-24 03:07:06 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-30 01:30:55 +0100
commit91126230cde39e3be3f07daa945cde9dc24af4fc (patch)
treeb74298c4df3ae88356003629c4853ec343306f37
parentc95ecd612512677a3c13659543359ccf666f0548 (diff)
downloadbcfg2-debian/1.2.3-3.tar.gz
bcfg2-debian/1.2.3-3.tar.bz2
bcfg2-debian/1.2.3-3.zip
Client: allow pre-Actions and important-Paths to enable installsdebian/1.2.3-3
This is used to first update the apt repositories and than install all current versions in one bcfg2-run. Also the installation of software from custom repositories (that are configured on the client via bcfg2) should be possible on the first run.
-rw-r--r--debian/changelog6
-rw-r--r--src/lib/Client/Frame.py23
-rw-r--r--src/lib/Client/Tools/APT.py5
3 files changed, 26 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog
index 27ca43db5..8863987a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+bcfg2 (1.2.3-3) unstable; urgency=low
+
+ * Client: allow pre-Actions and important-Paths to enable installs
+
+ -- Alexander Sulfrian <alex@spline.inf.fu-berlin.de> Thu, 24 Jan 2013 03:11:45 +0100
+
bcfg2 (1.2.3-2) unstable; urgency=low
* bump version
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index d17f70f1b..5826b36e8 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -162,14 +162,8 @@ class Frame:
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']:
@@ -190,6 +184,16 @@ class Frame:
self.logger.info(["%s:%s" % (e.tag, e.get('name')) for e in b_to_rem])
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 and not self.setup['bundle']:
for cfile in [cfl for cfl in self.config.findall(".//Path") \
@@ -411,6 +415,9 @@ class Frame:
self.CondDisplayState('initial')
self.InstallImportant()
self.Decide()
+ if self.modified:
+ self.Inventory()
+ self.GenerateActions()
self.Install()
self.times['install'] = time.time()
self.Remove()
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index dc6c9e6aa..156c86a2b 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -113,6 +113,11 @@ class APT(Bcfg2.Client.Tools.Tool):
type='deb', version=version) \
for (name, version) in extras]
+ def Inventory(self, states, structures=[]):
+ # reload pkg cache
+ self.pkg_cache.open(None)
+ Bcfg2.Client.Tools.Tool.Inventory(self, states, structures)
+
def VerifyDebsums(self, entry, modlist):
output = self.cmd.run("%s -as %s" % (DEBSUMS, entry.get('name')))[1]
if len(output) == 1 and "no md5sums for" in output[0]: