diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-04-11 21:40:13 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-04-11 21:40:13 +0000 |
commit | 52e4f75ac46ff4b98f349eadd8f2b90463a07c9a (patch) | |
tree | 98516bada84242ec161d9479e0dd54cb37ebf9c0 /src/lib/Client/Tools/POSIX.py | |
parent | 1a24d10ea4648c5279c1303b8c7b2f109154c13a (diff) | |
download | bcfg2-52e4f75ac46ff4b98f349eadd8f2b90463a07c9a.tar.gz bcfg2-52e4f75ac46ff4b98f349eadd8f2b90463a07c9a.tar.bz2 bcfg2-52e4f75ac46ff4b98f349eadd8f2b90463a07c9a.zip |
Fix unconditional inclusion of mtime installation fix (Resolves Ticket #424)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3036 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/POSIX.py')
-rw-r--r-- | src/lib/Client/Tools/POSIX.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py index 2eccedb2b..9908f3696 100644 --- a/src/lib/Client/Tools/POSIX.py +++ b/src/lib/Client/Tools/POSIX.py @@ -309,13 +309,14 @@ class POSIX(Bcfg2.Client.Tools.Tool): os.chown(newfile.name, 0, 0) os.chmod(newfile.name, calcPerms(S_IFREG, entry.get('perms'))) os.rename(newfile.name, entry.get('name')) - try: - os.utime(entry.get('name'), (int(entry.get('mtime')), - int(entry.get('mtime')))) - except: - self.logger.error("ConfigFile %s mtime fix failed" \ - % (entry.get('name'))) - return False + if entry.get('mtime', '-1') != '-1': + try: + os.utime(entry.get('name'), (int(entry.get('mtime')), + int(entry.get('mtime')))) + except: + self.logger.error("ConfigFile %s mtime fix failed" \ + % (entry.get('name'))) + return False return True except (OSError, IOError), err: if err.errno == 13: |