diff --git a/plugins/module_utils/ndb/time_machines.py b/plugins/module_utils/ndb/time_machines.py index dc54b0dc0..a5ed83b73 100644 --- a/plugins/module_utils/ndb/time_machines.py +++ b/plugins/module_utils/ndb/time_machines.py @@ -37,8 +37,11 @@ def get_time_machine(self, uuid=None, name=None, query=None): if uuid: resp = self.read(uuid=uuid, query=query) elif name: - endpoint = "{0}/{1}".format("name", name) - resp = self.read(endpoint=endpoint, query=query) + if not query: + query = {} + query["vaue_type"] = "name" + query["value"] = name + resp = self.read(query=query) if isinstance(resp, list): if not resp: return None, "Time machine with name {0} not found".format(name) diff --git a/plugins/modules/ntnx_ndb_time_machines_info.py b/plugins/modules/ntnx_ndb_time_machines_info.py index f3d9dc861..8fce6fdae 100644 --- a/plugins/modules/ntnx_ndb_time_machines_info.py +++ b/plugins/modules/ntnx_ndb_time_machines_info.py @@ -307,7 +307,7 @@ def get_time_machine(module, result): resp, err = tm.get_time_machine(uuid=uuid, name=name, query=query_params) if err: result["error"] = err - module.fail_json(msg="Failed fetching sla info", **result) + module.fail_json(msg="Failed fetching time machine info", **result) result["response"] = resp