Skip to content

Commit

Permalink
qvm-template: Replace newlines in machine-readable output.
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyPillow committed Aug 6, 2020
1 parent ed35802 commit ba7b113
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qubesadmin/tools/qvm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ def info_to_human_output(tpls):
outputs.append((status, output))
return outputs

def info_to_machine_output(tpls):
def info_to_machine_output(tpls, replace_newline=True):
outputs = []
for status, grp in itertools.groupby(tpls, lambda x: x[0]):
output = []
Expand All @@ -908,7 +908,8 @@ def info_to_machine_output(tpls):
dlsize = str(dlsize)
buildtime = str(buildtime)
install_time = str(install_time) if install_time else ''
# TODO: Escape newlines in description?
if replace_newline:
description = description.replace('\n', '|')
output.append((name, epoch, version, release, reponame,
dlsize, buildtime, install_time, licence, url, summary,
description))
Expand Down

0 comments on commit ba7b113

Please sign in to comment.