mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-20 11:50:22 -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
|
@ -508,15 +508,17 @@ ids:
|
|||
'''
|
||||
|
||||
import time
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
import traceback
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils.alicloud_ecs import ecs_argument_spec, ecs_connect
|
||||
|
||||
HAS_FOOTMARK = False
|
||||
|
||||
FOOTMARK_IMP_ERR = None
|
||||
try:
|
||||
from footmark.exception import ECSResponseError
|
||||
HAS_FOOTMARK = True
|
||||
except ImportError:
|
||||
FOOTMARK_IMP_ERR = traceback.format_exc()
|
||||
HAS_FOOTMARK = False
|
||||
|
||||
|
||||
|
@ -626,7 +628,7 @@ def main():
|
|||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
if HAS_FOOTMARK is False:
|
||||
module.fail_json(msg="Package 'footmark' required for the module ali_instance.")
|
||||
module.fail_json(msg=missing_required_lib('footmark'), exception=FOOTMARK_IMP_ERR)
|
||||
|
||||
ecs = ecs_connect(module)
|
||||
state = module.params['state']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue