diff options
author | Kotresh HR <khiremat@redhat.com> | 2018-09-24 21:18:30 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-10-05 14:22:54 +0000 |
commit | 1330456911f4e0606d9ebd103151917a160e2623 (patch) | |
tree | 0ac73ea6d0b263a0dcec91b3039ad5cda066377b /geo-replication/syncdaemon/subcmds.py | |
parent | 3acb6955594402835dea8e309f202a9fc9e38ae0 (diff) |
georep: python3 compatibility (Popen)
The file objects for python3 by default is opened
in binary mode where as in python2 it's opened
as text by default.
The geo-rep code parses the output of Popen assuming
it as text, hence used the 'universal_newlines' flag
which provides backward compatibility for the same.
Change-Id: I371a03b6348af9666164cb2e8b93d47475431ad9
Updates: #411
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 65aed1070cc2e44959cf3a0fbfde635de7e03103)
Diffstat (limited to 'geo-replication/syncdaemon/subcmds.py')
-rw-r--r-- | geo-replication/syncdaemon/subcmds.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/subcmds.py b/geo-replication/syncdaemon/subcmds.py index 11d263d7e03..30050ec4743 100644 --- a/geo-replication/syncdaemon/subcmds.py +++ b/geo-replication/syncdaemon/subcmds.py @@ -112,7 +112,8 @@ def subcmd_voluuidget(args): po = Popen(['gluster', '--xml', '--remote-host=' + args.host, 'volume', 'info', args.volname], bufsize=0, - stdin=None, stdout=PIPE, stderr=PIPE) + stdin=None, stdout=PIPE, stderr=PIPE, + universal_newlines=True) vix, err = po.communicate() if po.returncode != 0: |