diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-07-24 16:54:53 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-07-24 16:54:53 +0000 |
commit | 7632777cdaf499fb9fd8689a379ed6ae23d19da9 (patch) | |
tree | a197ec2ce75285925b13573159c74eb04ca2176d /src/lib | |
parent | 1e0a35491805c5a232962acdacb38c6e85f391fe (diff) | |
download | bcfg2-7632777cdaf499fb9fd8689a379ed6ae23d19da9.tar.gz bcfg2-7632777cdaf499fb9fd8689a379ed6ae23d19da9.tar.bz2 bcfg2-7632777cdaf499fb9fd8689a379ed6ae23d19da9.zip |
NagiosGen: Make properties use completely optional
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5384 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/NagiosGen.py | 6 |
1 files changed, 4 insertions, 2 deletions
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 ) |