summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2014-01-25 20:27:49 -0500
committerCole Robinson <crobinso@redhat.com>2014-01-25 20:30:08 -0500
commit6e06b3642b82269c346c5fc30147e7283a374ce0 (patch)
tree20c7c0a91c6c77c7bf40655b582b328c26335720
parent443ae1b3038b1c4e228df9ac88270352962ceb17 (diff)
downloadvirt-manager-6e06b3642b82269c346c5fc30147e7283a374ce0.tar.gz
cli: Explicitly error on cli options like --disk readonly
All options should be opt=val pairs, but we behaved weirdly on missing = before.
-rw-r--r--virtinst/cli.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py
index c0cb1c39..ac8ff257 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1070,7 +1070,12 @@ class VirtOptionString(object):
virtargmap, remove_first)
def get_opt_param(self, key):
- return self.opts.pop(key, None)
+ if key not in self.opts:
+ return None
+ ret = self.opts.pop(key)
+ if ret is None:
+ raise RuntimeError("Option '%s' had no value set." % key)
+ return ret
def check_leftover_opts(self):
if not self.opts: