From 254f98bdf52a6037544877d4a43e5be7347cf47f Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Thu, 5 Apr 2012 17:03:36 -0400 Subject: [PATCH] handle incorrect commands w/o '=' slightly better --- library/virt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/virt b/library/virt index 1922aefaaa3..c12ce9e21bd 100755 --- a/library/virt +++ b/library/virt @@ -194,9 +194,7 @@ class Virt(object): "nrVirtCpu" : data[3], "cpuTime" : str(data[4]), } - thisvm = self.conn.find_vm(vm) - if hasattr(thisvm, 'autostart'): - info[vm]["autostart"] = thisvm.autostart() + info[vm]["autostart"] = self.conn.get_autostart(vm) return info @@ -378,6 +376,10 @@ def main(): # command=[some command] [guest=name] params = {} + if '=' not in args: + msg = "No proper arguments provided to virt module: %s" % args + return VIRT_FAILED, msg + for x in items: (k, v) = x.split("=") params[k] = v