From 173e89a6506bc8c727ce6d8e5ac84b59ad2e21de Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 24 Sep 2018 20:56:21 +0530 Subject: georep: Fix python3 compatibility (os.pipe) 'os.pipe' returns pair of file descriptors which are non-inheritable by child processes. But geo-rep uses te inheritable nature of pipe fds to communicate between parent and child processes. Hence wrote a compatiable pipe routine which works well both with python2 and python3 with inheritable nature. Updates: #411 Change-Id: I869d7a52eeecdecf3851d44ed400e69b32a612d9 Signed-off-by: Kotresh HR --- geo-replication/syncdaemon/resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'geo-replication/syncdaemon/resource.py') diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index df4006f971a..cba47c82311 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -40,7 +40,7 @@ from syncdutils import GX_GFID_CANONICAL_LEN from gsyncdstatus import GeorepStatus from syncdutils import lf, Popen, sup from syncdutils import Xattr, matching_disk_gfid, get_gfid_from_mnt -from syncdutils import unshare_propagation_supported, get_slv_dir_path +from syncdutils import unshare_propagation_supported, get_slv_dir_path, pipe ENOTSUP = getattr(errno, 'ENOTSUP', 'EOPNOTSUPP') @@ -858,7 +858,7 @@ class Mounter(object): change into the mount, and lazy unmount the filesystem. """ - mpi, mpo = os.pipe() + mpi, mpo = pipe() mh = Popen.fork() if mh: # Parent -- cgit