handle incorrect commands w/o '=' slightly better

reviewable/pr18780/r1
Seth Vidal 13 years ago
parent c13c71c7d2
commit c7634619f3

@ -194,9 +194,7 @@ class Virt(object):
"nrVirtCpu" : data[3], "nrVirtCpu" : data[3],
"cpuTime" : str(data[4]), "cpuTime" : str(data[4]),
} }
thisvm = self.conn.find_vm(vm) info[vm]["autostart"] = self.conn.get_autostart(vm)
if hasattr(thisvm, 'autostart'):
info[vm]["autostart"] = thisvm.autostart()
return info return info
@ -378,6 +376,10 @@ def main():
# command=[some command] [guest=name] # command=[some command] [guest=name]
params = {} params = {}
if '=' not in args:
msg = "No proper arguments provided to virt module: %s" % args
return VIRT_FAILED, msg
for x in items: for x in items:
(k, v) = x.split("=") (k, v) = x.split("=")
params[k] = v params[k] = v

Loading…
Cancel
Save