From 2e06e300e6179d200d1bf7a8a2596baa2847fa83 Mon Sep 17 00:00:00 2001 From: WillyPillow Date: Wed, 26 Aug 2020 01:31:33 +0800 Subject: [PATCH] qvm-template: Tweak machine-readable output format. --- doc/manpages/qvm-template.rst | 4 ++-- qubesadmin/tools/qvm_template.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/manpages/qvm-template.rst b/doc/manpages/qvm-template.rst index 2b0c50bb..9c1ff00f 100644 --- a/doc/manpages/qvm-template.rst +++ b/doc/manpages/qvm-template.rst @@ -219,7 +219,7 @@ Options :: - |{status}|{name}|{evr}|{reponame}| + {status}|{name}|{evr}|{reponame} Where ``{status}`` can be one of ``installed``, ``available``, ``extra``, or ``upgradable``. @@ -307,7 +307,7 @@ Options :: - |{status}|{name}|{epoch}|{version}|{release}|{reponame}|{size}|{buildtime}|{installtime}|{license}|{url}|{summary}|{description}| + {status}|{name}|{epoch}|{version}|{release}|{reponame}|{size}|{buildtime}|{installtime}|{license}|{url}|{summary}|{description} Where ``{status}`` can be one of ``installed``, ``available``, ``extra``, or ``upgradable``. diff --git a/qubesadmin/tools/qvm_template.py b/qubesadmin/tools/qvm_template.py index 61736232..db04dff6 100644 --- a/qubesadmin/tools/qvm_template.py +++ b/qubesadmin/tools/qvm_template.py @@ -1082,9 +1082,8 @@ def append_vm(vm, status): elif operation == 'list': tpl_list = list_to_machine_output(tpl_list) for status, grp in tpl_list.items(): - print('|' + status) for line in grp: - print('|'.join(line.values()) + '|') + print('|'.join([status] + list(line.values()))) elif args.machine_readable_json: if operation == 'info': tpl_list = info_to_machine_output(tpl_list, replace_newline=False)