tools/qvm-features: fix handling empty list of features

This commit is contained in:
Marek Marczykowski-Górecki 2017-01-14 05:02:56 +01:00
parent 98edc9779c
commit 0c43329188
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -70,6 +70,10 @@ def main(args=None):
if args.delete:
parser.error('--unset requires a feature')
if not vm.features:
# max doesn't like empty list
return 0
width = max(len(feature) for feature in vm.features)
for feature in sorted(vm.features):
print('{name:{width}s} {value}'.format(