def getVirtualMachineByName(self, vm_name): """Obtain a VM object, based on VM name""" ArgumentValidator.validate_hostname(vm_name) if vm_name not in Factory.CACHED_OBJECTS: vm_object = VirtualMachine(self, vm_name) self._register_object(vm_object) Factory.CACHED_OBJECTS[vm_name] = vm_object return Factory.CACHED_OBJECTS[vm_name]
def getVirtualMachineByName(self, vm_name): """Obtain a VM object, based on VM name""" ArgumentValidator.validate_hostname(vm_name) vm_object = VirtualMachine(self, vm_name) self._register_object(vm_object) return vm_object