]> xenbits.xensource.com Git - xenrt-citrix/xenrt.git/commitdiff
Quering on empty=false to optimise the code
authorAkash Chandrashekar <akash.chandrashekar@citrix.com>
Thu, 19 Nov 2015 12:53:57 +0000 (18:23 +0530)
committerAkash Chandrashekar <akash.chandrashekar@citrix.com>
Thu, 19 Nov 2015 12:53:57 +0000 (18:23 +0530)
exec/xenrt/lib/xenserver/guest.py

index 0d4ee26dff6b7af223c691e5f8183687c4888f4a..ec44b5d2ff9aa1be654aaa9104f5d498edfdde24 100755 (executable)
@@ -2118,12 +2118,11 @@ exit /B 1
         """Remove the CD device from the VM."""
         cli = self.getCLIInstance()
         
-        cdvbds = self.getHost().minimalList("vbd-list","empty","vm-uuid=%s type=CD" % (self.getUUID()))
+        cdvbds = self.getHost().minimalList("vbd-list", args="vm-uuid=%s type=CD empty=false" % (self.getUUID()))
         if cdvbds:
-            if cdvbds[0] == "false":
-                args = []
-                args.append("uuid=%s" % (self.getUUID()))
-                cli.execute("vm-cd-eject", string.join(args))
+            args = []
+            args.append("uuid=%s" % (self.getUUID()))
+            cli.execute("vm-cd-eject", string.join(args))
         
 
     def createVIF(self, eth=None, bridge=None, mac=None, plug=False):