def get_resource(self, vm_id): vm = self._get_vm(vm_id) resource = Vm(vm_id) resource.flavor = vm.fake_vm_spec.flavor resource.state = self._power_state_to_resource_state(vm.state) resource.datastore = vm.fake_vm_spec.datastore resource.environment = vm.fake_vm_spec.env return resource