mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-21 16:39:08 -07:00
Final round of moving modules to new import error msg (#51852)
* Final round of moving modules to new import error msg * readd URL to jenkins install guide * fix unit tests
This commit is contained in:
parent
ffbc9d99de
commit
a39c4ad464
42 changed files with 292 additions and 150 deletions
|
@ -83,13 +83,17 @@ EXAMPLES = '''
|
|||
|
||||
RETURN = '''
|
||||
'''
|
||||
import traceback
|
||||
|
||||
MUNCH_IMP_ERR = None
|
||||
try:
|
||||
from munch import unmunchify
|
||||
HAS_MUNCH = True
|
||||
except ImportError:
|
||||
MUNCH_IMP_ERR = traceback.format_exc()
|
||||
HAS_MUNCH = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils.infinibox import HAS_INFINISDK, api_wrapper, get_system, infinibox_argument_spec
|
||||
|
||||
|
||||
|
@ -168,9 +172,9 @@ def main():
|
|||
module = AnsibleModule(argument_spec, supports_check_mode=True)
|
||||
|
||||
if not HAS_INFINISDK:
|
||||
module.fail_json(msg='infinisdk is required for this module')
|
||||
module.fail_json(msg=missing_required_lib('infinisdk'))
|
||||
if not HAS_MUNCH:
|
||||
module.fail_json(msg='the python munch library is required for this module')
|
||||
module.fail_json(msg=missing_required_lib('munch'), exception=MUNCH_IMP_ERR)
|
||||
|
||||
state = module.params['state']
|
||||
system = get_system(module)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue