dom0/qvm-tools: check property name in qubes-prefs

This commit is contained in:
Marek Marczykowski 2012-12-19 04:37:09 +01:00
parent 507e9652d6
commit 1d49bf9dc5

View File

@ -119,7 +119,7 @@ def main():
qvm_collection.unlock_db()
if options.do_set:
if len (args) < 2:
if len (args) < 2 or args[0] not in preferences.keys():
print >> sys.stderr, "You must specify the property and the new value you wish to set..."
print >> sys.stderr, "Available properties:"
for p in sorted(preferences.keys()):
@ -133,7 +133,7 @@ def main():
qvm_collection.unlock_db()
elif options.do_get:
if len (args) < 1:
if len (args) < 1 or args[0] not in preferences.keys():
print >> sys.stderr, "You must specify the property you wish to get..."
print >> sys.stderr, "Available properties:"
for p in sorted(preferences.keys()):