Преглед изворни кода

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.
Marek Marczykowski-Górecki пре 6 година
родитељ
комит
2459b8108b
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      qubesadmin/tools/qvm_prefs.py

+ 3 - 1
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))