예제 #1
0
 def testGetAll(self):
     """Test VirtualMachine.getAll()"""
     # Make sure we have at least one vm
     machine = VirtualMachine.open(self.testVMpath)
     machine.register()
     vms = VirtualMachine.getAll()
     self.assertTrue(len(vms) > 0)
     self.assertTrue(isinstance(vms[0], VirtualMachine))
     machine.unregister()
예제 #2
0
파일: pyvbox.py 프로젝트: szydre/pyVBox
 def invoke(cls, args):
     """Invoke the command. Return exit code for program."""
     vms = VirtualMachine.getAll()
     for vm in vms:
         try:
             print vm.name
         except VirtualBoxException as e:
             if verbosityLevel > 1:
                 errorMsg("Unknown machine: %s" % e)
     return 0
예제 #3
0
파일: pyvbox.py 프로젝트: aburan28/pyVBox
 def invoke(cls, args):
     """Invoke the command. Return exit code for program."""
     vms = VirtualMachine.getAll()
     for vm in vms:
         try:
             print vm.name
         except VirtualBoxException as e:
             if verbosityLevel > 1:
                 errorMsg("Unknown machine: %s"%e)
     return 0
예제 #4
0
파일: pyvbox.py 프로젝트: aburan28/pyVBox
 def invoke(cls, args):
     if len(args) == 0:
         vms = VirtualMachine.getAll()
         verboseMsg("Registered VMs:")
         for vm in vms:
             try:
                 print "\t%s" % vm
             except Exception as e:
                 errorMsg("Could not display VM: %s" % str(e))
     else:
         for vmName in args:
             try:
                 vm = VirtualMachine.find(vmName)
                 print_vm(vm)
             except Exception as e:
                 errorMsg("Could not display information about VM \"%s\": %s" % (vmName, str(e)))
예제 #5
0
파일: pyvbox.py 프로젝트: szydre/pyVBox
 def invoke(cls, args):
     if len(args) == 0:
         vms = VirtualMachine.getAll()
         verboseMsg("Registered VMs:")
         for vm in vms:
             try:
                 print "\t%s" % vm
             except Exception as e:
                 errorMsg("Could not display VM: %s" % str(e))
     else:
         for vmName in args:
             try:
                 vm = VirtualMachine.find(vmName)
                 print_vm(vm)
             except Exception as e:
                 errorMsg(
                     "Could not display information about VM \"%s\": %s" %
                     (vmName, str(e)))