mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-16 09:55:26 -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
|
@ -105,15 +105,20 @@ EXAMPLES = '''
|
|||
'''
|
||||
|
||||
RETURN = '''# '''
|
||||
import traceback
|
||||
|
||||
from os import getenv
|
||||
from os.path import isfile
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils._text import to_native
|
||||
|
||||
TAIGA_IMP_ERR = None
|
||||
try:
|
||||
from taiga import TaigaAPI
|
||||
from taiga.exceptions import TaigaException
|
||||
TAIGA_MODULE_IMPORTED = True
|
||||
except ImportError:
|
||||
TAIGA_IMP_ERR = traceback.format_exc()
|
||||
TAIGA_MODULE_IMPORTED = False
|
||||
|
||||
|
||||
|
@ -252,8 +257,8 @@ def main():
|
|||
)
|
||||
|
||||
if not TAIGA_MODULE_IMPORTED:
|
||||
msg = "This module needs python-taiga module"
|
||||
module.fail_json(msg=msg)
|
||||
module.fail_json(msg=missing_required_lib("python-taiga"),
|
||||
exception=TAIGA_IMP_ERR)
|
||||
|
||||
taiga_host = module.params['taiga_host']
|
||||
project_name = module.params['project']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue