Skip to content

Commit

Permalink
tools/qvm-prefs: fix printing None value
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marmarek committed Mar 4, 2018
1 parent 4a9b57f commit 2459b81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qubesadmin/tools/qvm_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 2459b81

Please sign in to comment.