From e4c2294ce0eb5e2d369f840c035c54ae80262f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 9 Mar 2017 01:39:11 +0100 Subject: [PATCH] tools/qvm-prefs: adjust for qubesmgmt module list_properties() returns strings, not property objects. --- qubesmgmt/tools/qvm_prefs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qubesmgmt/tools/qvm_prefs.py b/qubesmgmt/tools/qvm_prefs.py index 042847f..c0f9df5 100644 --- a/qubesmgmt/tools/qvm_prefs.py +++ b/qubesmgmt/tools/qvm_prefs.py @@ -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: