mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-04 15:29:10 -07:00
ModuleHelper: added a do_raise() method to MH base class (#4660)
* ModuleHelper: added a do_raise() method to MH base class * added changelog fragment * Update changelogs/fragments/4660-mh-added-do-raise.yaml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/module_utils/mh/base.py Co-authored-by: Felix Fontein <felix@fontein.de> * using do_raise in CmdMixin * simplified do_raise() Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
7c9ad3082d
commit
5d72d1be2f
3 changed files with 8 additions and 4 deletions
|
@ -31,6 +31,9 @@ class ModuleHelperBase(object):
|
|||
def diff_mode(self):
|
||||
return self.module._diff
|
||||
|
||||
def do_raise(self, *args, **kwargs):
|
||||
raise _MHE(*args, **kwargs)
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if attr in self._delegated_to_module:
|
||||
return getattr(self.module, attr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue