From 17d801958e683c5ff4a9122f9fd172f0be67f5a5 Mon Sep 17 00:00:00 2001 From: Mike McCallister Date: Mon, 25 Jul 2011 17:23:46 -0500 Subject: Update to Deps to eliminate "Failed to add dep entry for :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. --- src/lib/Server/Plugins/Deps.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib') 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: -- cgit v1.2.3-1-g7c22