def test_wait_and_get_portgroup_details_None(self):
     cfg = ovsvapp_vc_driver.CONF
     orig_cnt = cfg.vmware.vmwareapi_nic_attach_retry_count
     cfg.vmware.vmwareapi_nic_attach_retry_count = -1
     self.network_info = None
     self._create_vm()
     vss = vmwareapi_fake._get_objects("Network").objects[0]
     vm_ref = vmwareapi_fake._get_objects("VirtualMachine").objects[0].obj
     network_obj = (self.conn._wait_and_get_portgroup_details(
         self.conn._session, vm_ref, vss.get('summary.name'),
         self.instance))
     self.assertTrue(network_obj is None)
     cfg.vmware.vmwareapi_nic_attach_retry_count = orig_cnt
 def test_wait_and_get_portgroup_details_None(self):
     cfg = ovsvapp_vc_driver.CONF
     orig_cnt = cfg.vmware.vmwareapi_nic_attach_retry_count
     cfg.vmware.vmwareapi_nic_attach_retry_count = -1
     self.network_info = None
     self._create_vm()
     vss = vmwareapi_fake._get_objects("Network").objects[0]
     vm_ref = vmwareapi_fake._get_objects("VirtualMachine").objects[0].obj
     network_obj = (self.conn._wait_and_get_portgroup_details
                    (self.conn._session, vm_ref, vss.get('summary.name'),
                     self.instance))
     self.assertTrue(network_obj is None)
     cfg.vmware.vmwareapi_nic_attach_retry_count = orig_cnt
 def _get_vm_record(self):
     # Get record for VM
     vms = vmwareapi_fake._get_objects("VirtualMachine")
     for vm in vms.objects:
         if vm.get('name') == self.uuid:
             return vm
     self.fail('Unable to find VM backing!')
 def _get_vm_record(self):
     # Get record for VM
     vms = vmwareapi_fake._get_objects("VirtualMachine")
     for vm in vms.objects:
         if vm.get('name') == self.uuid:
             return vm
     self.fail('Unable to find VM backing!')