diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-10-13 14:14:23 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-10-13 14:14:23 +0000 |
commit | ddd214f50b7a43590aaad2a654f78f0921924eff (patch) | |
tree | 5e913dae9ad060c20205a7bea0da2224d99d0b5b /src/lib/Client/Toolset.py | |
parent | f66d3283abc72af103de9cb5781c62a3ab2c4772 (diff) | |
download | bcfg2-ddd214f50b7a43590aaad2a654f78f0921924eff.tar.gz bcfg2-ddd214f50b7a43590aaad2a654f78f0921924eff.tar.bz2 bcfg2-ddd214f50b7a43590aaad2a654f78f0921924eff.zip |
change symlink.from to symlink.name
2004/10/13 09:10:49-05:00 anl.gov!desai
handle 3 digit octal perms
(Logical change 1.91)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@425 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Toolset.py')
-rw-r--r-- | src/lib/Client/Toolset.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index 33dee5883..0e0a7c042 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -19,6 +19,7 @@ def print_success(): def CalcPerms(initial,perms): tempperms = initial + if len(perms) == 3: perms = '0%s'%(perms) (s,u,g,o) = map(int, map(lambda x:perms[x], range(4))) if s & 1: tempperms |= S_ISVTX @@ -158,7 +159,7 @@ class Toolset(object): def VerifySymLink(self, entry): try: - s = readlink(entry.attrib['from']) + s = readlink(entry.attrib['name']) if s == entry.attrib['to']: return True return False @@ -167,17 +168,17 @@ class Toolset(object): def InstallSymLink(self, entry): try: - fmode = lstat(entry.attrib['from'])[ST_MODE] + fmode = lstat(entry.attrib['name'])[ST_MODE] if S_ISREG(fmode) or S_ISLNK(fmode): - unlink(entry.attrib['from']) + unlink(entry.attrib['name']) elif S_ISDIR(fmode): - system("mv %s/ %s.bak"%(entry.attrib['from'], entry.attrib['from'])) + system("mv %s/ %s.bak"%(entry.attrib['name'], entry.attrib['name'])) else: - unlink(entry.attrib['from']) + unlink(entry.attrib['name']) except OSError, e: pass try: - symlink(entry.attrib['to'], entry.attrib['from']) + symlink(entry.attrib['to'], entry.attrib['name']) except OSError, e: return False |