Multiple modules using ModuleHelper (#4674) (#4713)

* Multiple modules using ModuleHelper

Replaced raising exception with calling method do_raise() in MH.
Removed the importing of the exception class.

* added changelog fragment

(cherry picked from commit 6052776de1)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2022-05-23 07:32:54 +02:00 committed by GitHub
commit 7569d6315c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 35 deletions

View file

@ -146,7 +146,7 @@ RETURN = '''
'''
from ansible_collections.community.general.plugins.module_utils.module_helper import (
CmdStateModuleHelper, ArgFormat, ModuleHelperException
CmdStateModuleHelper, ArgFormat
)
@ -212,7 +212,7 @@ class XFConfProperty(CmdStateModuleHelper):
self.vars.meta('value').set(initial_value=self.vars.previous_value)
if self.module.params['disable_facts'] is False:
raise ModuleHelperException('Returning results as facts has been removed. Stop using disable_facts=false.')
self.do_raise('Returning results as facts has been removed. Stop using disable_facts=false.')
def process_command_output(self, rc, out, err):
if err.rstrip() == self.does_not: