summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-07-14 16:10:43 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-07-14 16:10:43 +0000
commitcd89c695f97789e9f04a9eb849e83609249e9ee3 (patch)
treeea5f355e541a7c1506ccc5da6922e1dc85c0466b /src
parent28995453682effde0eff414333ef2973e2c52fec (diff)
downloadbcfg2-cd89c695f97789e9f04a9eb849e83609249e9ee3.tar.gz
bcfg2-cd89c695f97789e9f04a9eb849e83609249e9ee3.tar.bz2
bcfg2-cd89c695f97789e9f04a9eb849e83609249e9ee3.zip
Improvements to the Deps plugin
* Handle recursive dependencies properly (ChrisV) * Fix raise of PluginExecutionError git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1943 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Deps.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Deps.py b/src/lib/Server/Plugins/Deps.py
index 945c53e70..c2de2d406 100644
--- a/src/lib/Server/Plugins/Deps.py
+++ b/src/lib/Server/Plugins/Deps.py
@@ -65,7 +65,9 @@ class Deps(Bcfg2.Server.Plugin.PrioDir):
else:
[src.Cache(metadata) for src in self.entries.values()]
- for entry in entries:
+ toexamine = entries[:]
+ while toexamine:
+ entry = toexamine.pop()
matching = [src for src in self.entries.values()
if src.cache and src.cache[1].has_key(entry[0])
and src.cache[1][entry[0]].has_key(entry[1])]
@@ -74,15 +76,16 @@ class Deps(Bcfg2.Server.Plugin.PrioDir):
if prio.count(max(prio)) > 1:
self.logger.error("Found conflicting %s sources with same priority for %s, pkg %s" %
(entry[0].lower(), metadata.hostname, entry[1]))
- raise PluginExecutionError
+ raise Bcfg2.Server.Plugin.PluginExecutionError
index = prio.index(max(prio))
matching = [matching[index]]
if not matching:
continue
elif len(matching) == 1:
- for prq in src.cache[1][entry[0]][entry[1]]:
- if prq not in prereqs:
+ for prq in matching[0].cache[1][entry[0]][entry[1]]:
+ if prq not in prereqs and prq not in entries:
+ toexamine.append(prq)
prereqs.append(prq)
self.cache[(entries, gdata)] = prereqs