diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-10-26 16:05:58 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-10-26 16:05:58 +0000 |
commit | 07f34361d5888a82226c80d96688150f0a18835f (patch) | |
tree | f70fbea059f5e372ee9d4da2dd432c6808afd256 /src/lib/Client/Toolset.py | |
parent | fe4c4bba4671f11b3b2de9aa66c29987971e4fe1 (diff) | |
download | bcfg2-07f34361d5888a82226c80d96688150f0a18835f.tar.gz bcfg2-07f34361d5888a82226c80d96688150f0a18835f.tar.bz2 bcfg2-07f34361d5888a82226c80d96688150f0a18835f.zip |
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
Diffstat (limited to 'src/lib/Client/Toolset.py')
-rw-r--r-- | src/lib/Client/Toolset.py | 7 |
1 files changed, 5 insertions, 2 deletions
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: |