update to match current error messages
[invirt/packages/invirt-web.git] / code / controls.py
index 1d9b824..cd2d926 100644 (file)
@@ -201,7 +201,7 @@ def listHost(machine):
     out, err = remctl('control', machine.name, 'listhost', err=True)
     if err:
         return None
-    return out
+    return out.strip()
 
 def deleteVM(machine):
     """Delete a VM."""
@@ -242,7 +242,7 @@ def commandResult(username, state, fields):
             out, err = remctl('control', machine.name, 'reboot',
                               err=True)
         if err:
-            if re.match("Error: Domain '.*' does not exist.", err):
+            if re.match("machine '.*' is not on", err):
                 raise InvalidInput("action", "reboot", 
                                    "Machine is not on")
             else: