From dac88b71a1ea84f844a90925de8e479f270f9982 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 1 Aug 2007 14:35:49 +0000 Subject: fix for Cfg file pull git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3590 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Cfg.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py index 207f4465f..aed17382c 100644 --- a/src/lib/Server/Plugins/Cfg.py +++ b/src/lib/Server/Plugins/Cfg.py @@ -373,7 +373,12 @@ class Cfg(Bcfg2.Server.Plugin.Plugin): answer = raw_input(gsq) if answer in 'Yy': - update_file(basefile.name, diff) + print "writing file, %s" % basefile.name + if fulldata: + newdata = fulldata + else: + newdata = '\n'.join(difflib.restore(diff.split('\n'), 1)) + open(basefile.name, 'w').write(newdata) return if ".H_%s" % (meta.hostname) in basefile.name: -- cgit v1.2.3-1-g7c22