summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-06-25 14:36:33 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-06-25 14:36:33 -0400
commit94788714a2867ebc2fcc5b80ba8a0939dcb9aa48 (patch)
tree33517e12a58c85aac619a81a89b240927321c702 /src/lib/Bcfg2/Server/Plugins/NagiosGen.py
parente93478e013d1cda7f77771f622f5c99ac0199979 (diff)
downloadbcfg2-94788714a2867ebc2fcc5b80ba8a0939dcb9aa48.tar.gz
bcfg2-94788714a2867ebc2fcc5b80ba8a0939dcb9aa48.tar.bz2
bcfg2-94788714a2867ebc2fcc5b80ba8a0939dcb9aa48.zip
unified [Single]XMLFileBacked, enabled xinclude pretty much everywhere
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/NagiosGen.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/NagiosGen.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/NagiosGen.py b/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
index 4e8b09f30..f2b8336e0 100644
--- a/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
+++ b/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
@@ -14,25 +14,16 @@ LOGGER = logging.getLogger('Bcfg2.Plugins.NagiosGen')
line_fmt = '\t%-32s %s'
-class NagiosGenConfig(Bcfg2.Server.Plugin.SingleXMLFileBacked,
- Bcfg2.Server.Plugin.StructFile):
+class NagiosGenConfig(Bcfg2.Server.Plugin.StructFile):
def __init__(self, filename, fam):
# create config.xml if missing
if not os.path.exists(filename):
LOGGER.warning("NagiosGen: %s missing. "
"Creating empty one for you." % filename)
- f = open(filename, "w")
- f.write("<NagiosGen></NagiosGen>")
- f.close()
+ open(filename, "w").write("<NagiosGen></NagiosGen>")
- try:
- Bcfg2.Server.Plugin.SingleXMLFileBacked.__init__(self,
- filename,
- fam)
- except OSError:
- LOGGER.error("NagiosGen: Failed to read configuration file: %s" % err)
- raise Bcfg2.Server.Plugin.PluginInitError(msg)
- Bcfg2.Server.Plugin.StructFile.__init__(self, filename)
+ Bcfg2.Server.Plugin.StructFile.__init__(self, filename, fam=fam,
+ should_monitor=True)
class NagiosGen(Bcfg2.Server.Plugin.Plugin,