Skip to content

Commit

Permalink
tools/qvm-prefs: adjust for qubesmgmt module
Browse files Browse the repository at this point in the history
list_properties() returns strings, not property objects.
  • Loading branch information
marmarek committed Mar 9, 2017
1 parent bf03f66 commit e4c2294
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qubesmgmt/tools/qvm_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ def process_actions(parser, args, target):
'''
if args.property is None:
properties = target.property_list()
width = max(len(prop.__name__) for prop in properties)
width = max(len(prop) for prop in properties)

for prop in sorted(properties):
try:
value = getattr(target, prop.__name__)
value = getattr(target, prop)
except AttributeError:
print('{name:{width}s} U'.format(
name=prop.__name__, width=width))
name=prop, width=width))
continue

if target.property_is_default(prop):
print('{name:{width}s} D {value!s}'.format(
name=prop.__name__, width=width, value=value))
name=prop, width=width, value=value))
else:
print('{name:{width}s} - {value!s}'.format(
name=prop.__name__, width=width, value=value))
name=prop, width=width, value=value))

return 0
else:
Expand Down

0 comments on commit e4c2294

Please sign in to comment.