From 9cae19f821d963e93eb01ec41ed9c297166e3642 Mon Sep 17 00:00:00 2001 From: AnsibleGuy Date: Mon, 1 Jan 2024 17:54:52 +0100 Subject: [PATCH] using api-get/post wrappers in module-base --- plugins/module_utils/base/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/module_utils/base/base.py b/plugins/module_utils/base/base.py index a8812827..085faf74 100644 --- a/plugins/module_utils/base/base.py +++ b/plugins/module_utils/base/base.py @@ -61,7 +61,7 @@ def __init__(self, instance): def search(self, fail_response: bool = False) -> (dict, list): if fail_response: # find response keys in initial development - exit_debug(self.i.s.get(cnf={ + exit_debug(self._api_get(cnf={ **self.i.call_cnf, **{'command': self.i.CMDS['search']} })) @@ -74,7 +74,7 @@ def search(self, fail_response: bool = False) -> (dict, list): if hasattr(self.i, self.ATTR_GET_MOD): mod_get = getattr(self.i, self.ATTR_GET_MOD) - data = self.i.s.get(cnf={ + data = self._api_get(cnf={ **self.i.call_cnf, **{ 'module': mod_get, @@ -168,7 +168,7 @@ def create(self) -> dict: self.i.r['changed'] = True if not self.i.m.check_mode: - return self.i.s.post(cnf={ + return self._api_post(cnf={ **self.i.call_cnf, **{ 'command': self.i.CMDS['add'], 'data': self._get_request_data(), @@ -290,7 +290,7 @@ def reload(self) -> dict: cont_rel = getattr(self.i, self.ATTR_REL_CONT) if not self.i.m.check_mode: - return self.i.s.post(cnf={ + return self._api_post(cnf={ 'module': self.i.API_MOD, 'controller': cont_rel, 'command': self.i.API_CMD_REL,