Skip to content

Commit

Permalink
using api-get/post wrappers in module-base
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jan 1, 2024
1 parent 7553969 commit 9cae19f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/module_utils/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']}
}))

Expand All @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9cae19f

Please sign in to comment.