georep: python2 to python3 compat - scheduler

1. scheduler - Popen
2. syncdutils - corner case on failure

fixes: bz#1643932
Change-Id: I65af97a244a8790e976acedc2728db6ebbf2ae10
Signed-off-by: Kotresh HR <khiremat@redhat.com>
This commit is contained in:
Kotresh HR 2018-10-29 17:55:28 +05:30 committed by Amar Tumballi
parent 6cc573631d
commit 33e96100e1
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ def execute(cmd, success_msg="", failure_msg="", exitcode=-1):
On success it can print message in stdout if specified.
On failure, exits after writing to stderr.
"""
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
out, err = p.communicate()
if p.returncode == 0:
if success_msg:

View File

@ -847,7 +847,7 @@ class Popen(subprocess.Popen):
break
b = os.read(self.stderr.fileno(), 1024)
if b:
elines.append(b)
elines.append(b.decode())
else:
break
self.stderr.close()