Restart the guest if exception raised

Signed-off-by: Feng Yang <[email protected]>
---
 virttest/virt_vm.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/virttest/virt_vm.py b/virttest/virt_vm.py
index 1a39a50..88c8226 100644
--- a/virttest/virt_vm.py
+++ b/virttest/virt_vm.py
@@ -440,8 +440,12 @@ class BaseVM(object):
         Verifies whether the current virt_install commandline matches the
         requested one, based on the test parameters.
         """
-        if (self.make_create_command() !=
-                self.make_create_command(name, params, basedir)):
+        try:
+            need_restart = (self.make_create_command() !=
+                           self.make_create_command(name, params, basedir))
+        except Exception, e:
+           need_restart = True
+        if need_restart:
             logging.debug("VM params in env don't match requested, 
restarting.")
             return True
         else:
-- 
1.7.1

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to