summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorMike McCallister <mike@mccllstr.com>2011-07-25 17:23:46 -0500
committerMike McCallister <mike@mccllstr.com>2011-07-25 17:23:46 -0500
commit17d801958e683c5ff4a9122f9fd172f0be67f5a5 (patch)
treed260747484a38fdc8dd0d3c5630aeeb140e00a4b /src/lib
parent7e06e71fb12413b5179a151a99fcfea94ee004d7 (diff)
downloadbcfg2-17d801958e683c5ff4a9122f9fd172f0be67f5a5.tar.gz
bcfg2-17d801958e683c5ff4a9122f9fd172f0be67f5a5.tar.bz2
bcfg2-17d801958e683c5ff4a9122f9fd172f0be67f5a5.zip
Update to Deps to eliminate "Failed to add dep entry for <built-in function Comment>:None" warning.
Comments in the Deps file (inside a Package element) will cause the above error. In generating the prerequisites, we can eliminate this by looking for callable() items and excluding them.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Deps.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Deps.py b/src/lib/Server/Plugins/Deps.py
index 3a538292e..482d457af 100644
--- a/src/lib/Server/Plugins/Deps.py
+++ b/src/lib/Server/Plugins/Deps.py
@@ -122,7 +122,12 @@ class Deps(Bcfg2.Server.Plugin.PrioDir,
matching = [matching[index]]
elif len(matching) == 1:
for prq in matching[0].cache[1][entry[0]][entry[1]]:
- if prq not in prereqs and prq not in entries:
+ # XML comments seem to show up in the cache as a
+ # tuple with item 0 being callable. The logic
+ # below filters them out. Would be better to
+ # exclude them when we load the cache in the first
+ # place.
+ if prq not in prereqs and prq not in entries and not callable(prq[0]):
toexamine.append(prq)
prereqs.append(prq)
else: