From 2459b8108bb2187ee0d0569a847632fcf5170940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 2 Mar 2018 02:41:47 +0100 Subject: [PATCH] tools/qvm-prefs: fix printing None value Don't print None value as 'None' string, but as empty one (same as at API level). Otherwise it is indistinguishable from VM named 'None', or same string property value. --- qubesadmin/tools/qvm_prefs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qubesadmin/tools/qvm_prefs.py b/qubesadmin/tools/qvm_prefs.py index c1da905..0dde1f9 100644 --- a/qubesadmin/tools/qvm_prefs.py +++ b/qubesadmin/tools/qvm_prefs.py @@ -126,7 +126,9 @@ def process_actions(parser, args, target): return 0 try: - print(str(getattr(target, args.property))) + value = getattr(target, args.property) + if value is not None: + print(str(value)) except AttributeError: parser.error('no such property: {!r}'.format(args.property))