diff options
author | Csaba Henk <csaba@gluster.com> | 2011-02-07 01:32:57 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-07 00:59:22 -0800 |
commit | 31efe81b13d6761cf153e71f7ac150751b2d4090 (patch) | |
tree | e169823dc15aa2ad602ad5efd5bb719ea616b30c /xlators/features/marker/utils/syncdaemon/resource.py | |
parent | d376253d1e91b9fc29f6a23253021647e139c2c1 (diff) |
syncdaemon: add "setattr" server method, needed to synchronize metadata of links/dirs
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2318 (gsyncd.py :chmod on directory not working)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2318
Diffstat (limited to 'xlators/features/marker/utils/syncdaemon/resource.py')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/resource.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index f484d1de5..7ba7cb9d4 100644 --- a/xlators/features/marker/utils/syncdaemon/resource.py +++ b/xlators/features/marker/utils/syncdaemon/resource.py @@ -1,6 +1,7 @@ import re import os import sys +import stat import time import errno import struct @@ -157,6 +158,18 @@ class Server(object): Xattr.lsetxattr(path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), struct.pack('!II', *mark)) @staticmethod + def setattr(path, adct): + own = adct.get('own') + if own: + os.lchown(path, *own) + mode = adct.get('mode') + if mode: + os.chmod(path, stat.S_IMODE(mode)) + times = adct.get('times') + if times: + os.utime(path, times) + + @staticmethod def pid(): return os.getpid() |