summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/marker/utils/syncdaemon/master.py16
-rw-r--r--xlators/features/marker/utils/syncdaemon/resource.py9
2 files changed, 16 insertions, 9 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/master.py b/xlators/features/marker/utils/syncdaemon/master.py
index 1abd03252..0f12f96cf 100644
--- a/xlators/features/marker/utils/syncdaemon/master.py
+++ b/xlators/features/marker/utils/syncdaemon/master.py
@@ -117,7 +117,21 @@ class GMaster(object):
return
if path == '.':
self.change_seen = True
- dem, des = ( x.server.entries(path) for x in (self.master, self.slave) )
+ try:
+ dem = self.master.server.entries(path)
+ except OSError:
+ self.add_failjob(path, 'local-entries-fail')
+ return
+ try:
+ des = self.slave.server.entries(path)
+ except OSError:
+ self.slave.server.purge(path)
+ try:
+ self.slave.server.mkdir(path)
+ des = self.slave.server.entries(path)
+ except OSError:
+ self.add_failjob(path, 'remote-entries-fail')
+ return
dd = set(des) - set(dem)
if dd:
self.slave.server.purge(path, dd)
diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py
index 55c6e4dd7..dc3279d52 100644
--- a/xlators/features/marker/utils/syncdaemon/resource.py
+++ b/xlators/features/marker/utils/syncdaemon/resource.py
@@ -93,14 +93,7 @@ class Server(object):
@staticmethod
def entries(path):
- try:
- return os.listdir(path)
- except OSError:
- ex = sys.exc_info()[1]
- if ex.errno == ENOTDIR:
- return []
- else:
- raise
+ return os.listdir(path)
@classmethod
def purge(cls, path, entries=None):