qubes/tools: accept properties with '-'

'-' is invalid character in python identifier, so all the properties
have '_'. But in previous versions qvm-* tools accepted names with '-',
so lets not break this.

QubesOS/qubes-issues#2412
This commit is contained in:
Marek Marczykowski-Górecki 2016-11-02 06:21:42 +01:00
parent 880566a387
commit cc440c62f6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 4 additions and 0 deletions

View File

@ -87,6 +87,8 @@ def main(args=None):
name=prop.__name__, width=width, value=value))
return 0
else:
args.property = args.property.replace('-', '_')
if args.value is not None:

View File

@ -91,6 +91,8 @@ def main(args=None):
name=prop.__name__, width=width, value=value))
return 0
else:
args.property = args.property.replace('-', '_')
if args.property not in [prop.__name__
for prop in args.domain.property_list()]: