summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-10-31 19:20:45 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-10-31 19:20:45 +0000
commitea23e67cb34e599b899afeb56f63726bf6be9157 (patch)
tree50304143a47468de0ab59fc25a2eec1c180907d0 /src/lib/Server/Plugins
parente2353dfa1e3c9b64400601ce88bd020d513964c4 (diff)
downloadbcfg2-ea23e67cb34e599b899afeb56f63726bf6be9157.tar.gz
bcfg2-ea23e67cb34e599b899afeb56f63726bf6be9157.tar.bz2
bcfg2-ea23e67cb34e599b899afeb56f63726bf6be9157.zip
check if content updates are needed
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4959 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins')
-rw-r--r--src/lib/Server/Plugins/Cfg.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index 02067843d..864d4a8d4 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -104,10 +104,11 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
return "%s.H_%s" % (bfname, specific.hostname)
def write_update(self, specific, new_entry, log):
- name = self.build_filename(specific)
- open(name, 'w').write(new_entry['text'])
- if log:
- logger.info("Wrote file %s" % name)
+ if 'text' in new_entry:
+ name = self.build_filename(specific)
+ open(name, 'w').write(new_entry['text'])
+ if log:
+ logger.info("Wrote file %s" % name)
badattr = [attr for attr in ['owner', 'group', 'perms'] if attr in new_entry]
if badattr:
if self.infoxml: