Skip to content

Commit

Permalink
unify python major version bytes/str handling; close #146
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed May 1, 2019
1 parent 5612d74 commit da8ad71
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def start_pipeline(self, args=None, multi=False):
print("* " + "Pypiper hash".rjust(20) + ": " + str(gitvars['pypiper_hash']))
print("* " + "Pypiper branch".rjust(20) + ": " + str(gitvars['pypiper_branch']))
print("* " + "Pypiper date".rjust(20) + ": " + str(gitvars['pypiper_date']))
if "" != str(gitvars['pypiper_diff'].decode()):
if gitvars['pypiper_diff']:
print("* " + "Pypiper diff".rjust(20) + ": " + str(gitvars['pypiper_diff']))
except KeyError:
# It is ok if keys aren't set, it means pypiper isn't in a git repo.
Expand Down Expand Up @@ -1922,9 +1922,8 @@ def _memory_usage(self, pid='self', category="hwm", container=None):
# TODO: Put some debug output here with switch to Logger
# since this is relatively untested.
cmd = "docker stats " + container + " --format '{{.MemUsage}}' --no-stream"
mem_use_str = subprocess.check_output(cmd, shell=True).decode().print()
mem_use = mem_use_str.split("/")[0].split()

mem_use_str = subprocess.check_output(cmd, shell=True).decode()

mem_num = re.findall('[\d\.]+', mem_use_str.split("/")[0])[0]
mem_scale = re.findall('[A-Za-z]+', mem_use_str.split("/")[0])[0]

Expand Down

0 comments on commit da8ad71

Please sign in to comment.