From 7632777cdaf499fb9fd8689a379ed6ae23d19da9 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Fri, 24 Jul 2009 16:54:53 +0000 Subject: NagiosGen: Make properties use completely optional git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5384 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/NagiosGen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Plugins/NagiosGen.py b/src/lib/Server/Plugins/NagiosGen.py index 3eba10da8..8ea0a1547 100644 --- a/src/lib/Server/Plugins/NagiosGen.py +++ b/src/lib/Server/Plugins/NagiosGen.py @@ -44,8 +44,10 @@ class NagiosGen(Bcfg2.Server.Plugin.Plugin, if host_groups: host_config += ' hostgroups %s\n' % (",".join(host_groups)) - if 'NagiosGen.xml' in metadata.Properties and \ - metadata.Properties['NagiosGen.xml'].data.find(metadata.hostname) is not None: + if hasattr(metadata, 'Properties') and \ + 'NagiosGen.xml' in metadata.Properties and \ + metadata.Properties['NagiosGen.xml'].data.find(metadata.hostname) \ + is not None: directives = list (metadata.Properties['NagiosGen.xml'].data.find(metadata.hostname)) for item in directives: host_config += ' %-32s %s\n' % ( item.tag, item.text ) -- cgit v1.2.3-1-g7c22