From 07f34361d5888a82226c80d96688150f0a18835f Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 26 Oct 2004 16:05:58 +0000 Subject: fix paranoid mode like Gene wants it. 2004/10/26 10:53:19-05:00 anl.gov!desai add fallback case for ConfigFile Installation (Logical change 1.114) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@509 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Toolset.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/Client/Toolset.py') diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index fb037f206..3b5c08b97 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -272,10 +272,13 @@ class Toolset(object): filedata = entry.text newfile.write(filedata) newfile.close() - chown(newfile.name, getpwnam(entry.get('owner'))[2], getgrnam(entry.get('group'))[2]) + try: + chown(newfile.name, getpwnam(entry.get('owner'))[2], getgrnam(entry.get('group'))[2]) + except: + chown(newfile.name, 0, 0) chmod(newfile.name, calc_perms(S_IFREG, entry.get('perms'))) if entry.get("paranoid", False) and self.setup.get("paranoid", False): - system("diff -u %s %s.new"%(entry.get('name'), entry.get('name'))) + system("cp %s /var/cache/bcfg2/%s" % (entry.get('name'))) rename(newfile.name, entry.get('name')) return True except (OSError, IOError), e: -- cgit v1.2.3-1-g7c22