Skip to content

Commit

Permalink
fix for issue#360
Browse files Browse the repository at this point in the history
  • Loading branch information
Gevorg-Khachatryaan authored and Gevorg-Khachatryaan committed Oct 3, 2023
1 parent 923e9c7 commit b17858a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion plugins/module_utils/prism/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _build_spec_cluster(self, payload, param):
uuid, err = get_cluster_uuid(param, self.module)
if err:
return None, err
payload["spec"]["cluster_reference"]["uuid"] = uuid
payload["spec"]["cluster_reference"] = {"kind": "cluster", "uuid": uuid}
return payload, None

def _build_spec_vcpus(self, payload, vcpus):
Expand Down Expand Up @@ -340,7 +340,10 @@ def _build_spec_disks(self, payload, vdisks):
return payload, None

def _build_spec_boot_config(self, payload, param):
if not payload["spec"]["resources"].get("boot_config"):
payload["spec"]["resources"]["boot_config"] = self._get_default_spec()["spec"]["resources"]["boot_config"]
boot_config = payload["spec"]["resources"]["boot_config"]

if "LEGACY" == param["boot_type"] and "boot_order" in param:
boot_config["boot_device_order_list"] = param["boot_order"]

Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/ntnx_vms_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def get_module_spec():

def clone_vm(module, result):
src_vm_uuid = module.params["src_vm_uuid"]
result["src_vm_uuid"] = src_vm_uuid

vm = VM(module)

Expand All @@ -305,7 +306,8 @@ def clone_vm(module, result):

if module.params.get("wait"):
wait_for_task_completion(module, result)
resp = vm.read(src_vm_uuid)
vm_uuid = result["response"]["entity_reference_list"][0]["uuid"]
resp = vm.read(vm_uuid)
result["response"] = resp


Expand Down

0 comments on commit b17858a

Please sign in to comment.