stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=None, env=env)
if run.returncode:
logg.warning("EXIT %s: %s", run.returncode, command)
- output, errors = run.communicate() # run.wait()
+ output, errors = run.communicate()
+ output = output.decode('utf-8')
+ errors = errors.decode('utf-8')
except:
logg.error("*E*: %s", sh_command)
for line in output.split("\n"):
def output(cmd, shell=True):
run = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE)
out, err = run.communicate()
- return out
+ return out.decode('utf-8')
def grep(pattern, lines):
if isinstance(lines, basestring):
lines = lines.split("\n")