summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Cfg.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index d2e6e8a1d..1ea8e4e75 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -221,32 +221,32 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
return "%s.H_%s" % (bfname, specific.hostname)
def write_update(self, specific, new_entry, log):
- # FIXME: need to redo print with python's logging module
if 'text' in new_entry:
name = self.build_filename(specific)
if os.path.exists("%s.genshi" % name):
- print("Cfg: Unable to pull data for genshi types")
+ self.logger.error("Cfg: Unable to pull data for genshi types")
raise Bcfg2.Server.Plugin.PluginExecutionError
elif os.path.exists("%s.cheetah" % name):
- print("Cfg: Unable to pull data for cheetah types")
+ self.logger.error("Cfg: Unable to pull data for cheetah types")
raise Bcfg2.Server.Plugin.PluginExecutionError
try:
etext = new_entry['text'].encode(self.encoding)
except:
- print("Cfg: Cannot encode content of %s as %s" % (name, self.encoding))
+ self.logger.error("Cfg: Cannot encode content of %s as %s" % (name, self.encoding))
raise Bcfg2.Server.Plugin.PluginExecutionError
open(name, 'w').write(etext)
- if log:
- print("Wrote file %s" % name)
+ self.debug_log("Wrote file %s" % name, flag=log)
badattr = [attr for attr in ['owner', 'group', 'perms']
if attr in new_entry]
if badattr:
# check for info files and inform user of their removal
if os.path.exists(self.path + "/:info"):
- print("Removing :info file and replacing with info.xml")
+ self.logger.info("Removing :info file and replacing with "
+ "info.xml")
os.remove(self.path + "/:info")
if os.path.exists(self.path + "/info"):
- print("Removing info file and replacing with info.xml")
+ self.logger.info("Removing info file and replacing with "
+ "info.xml")
os.remove(self.path + "/info")
metadata_updates = {}
metadata_updates.update(self.metadata)
@@ -259,8 +259,8 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
ofile = open(self.path + "/info.xml", "w")
ofile.write(lxml.etree.tostring(infoxml, pretty_print=True))
ofile.close()
- if log:
- print("Wrote file %s" % (self.path + "/info.xml"))
+ self.debug_log("Wrote file %s" % (self.path + "/info.xml"),
+ flag=log)
class Cfg(Bcfg2.Server.Plugin.GroupSpool,