diff options
-rw-r--r-- | geo-replication/syncdaemon/syncdutils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/syncdutils.py b/geo-replication/syncdaemon/syncdutils.py index 23db55e2e80..6af957ddb4a 100644 --- a/geo-replication/syncdaemon/syncdutils.py +++ b/geo-replication/syncdaemon/syncdutils.py @@ -203,7 +203,12 @@ def finalize(*a, **kw): else: raise if gconf.ssh_ctl_dir and not gconf.cpid: - shutil.rmtree(gconf.ssh_ctl_dir) + def handle_rm_error(func, path, exc_info): + if exc_info[1].errno == ENOENT: + return + raise exc_info[1] + + shutil.rmtree(gconf.ssh_ctl_dir, onerror=handle_rm_error) if getattr(gconf, 'state_socket', None): try: os.unlink(gconf.state_socket) |