From d9f66bb49a6053ecfc50164bcef29f5a12c25085 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 16 Aug 2012 08:43:05 -0400 Subject: FileProbes: fixed bug introduced by Cfg rewrite --- src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py index 5a7edbaff..e93fb9da7 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py @@ -407,6 +407,19 @@ class Cfg(Bcfg2.Server.Plugin.GroupSpool, SETUP.add_option('validate', Bcfg2.Options.CFG_VALIDATION) SETUP.reparse() + def has_generator(self, entry, metadata): + """ return True if the given entry can be generated for the + given metadata; False otherwise """ + if entry.get('name') not in self.entries: + return False + + for ent in self.entries[entry.get('name')].entries.values(): + if ent.__specific__ and not ent.specific.matches(metadata): + continue + if isinstance(ent, CfgGenerator): + return True + return False + def AcceptChoices(self, entry, metadata): return self.entries[entry.get('name')].list_accept_choices(entry, metadata) -- cgit v1.2.3-1-g7c22