cli: Explicitly error on cli options like --disk readonly

All options should be opt=val pairs, but we behaved weirdly on missing
= before.
This commit is contained in:
Cole Robinson 2014-01-25 20:27:49 -05:00
parent 443ae1b303
commit 6e06b3642b

View File

@ -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: