mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-16 01:45:25 -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
|
@ -137,13 +137,15 @@ import ssl
|
|||
import fnmatch
|
||||
import traceback
|
||||
|
||||
JENKINS_IMP_ERR = None
|
||||
try:
|
||||
import jenkins
|
||||
HAS_JENKINS = True
|
||||
except ImportError:
|
||||
JENKINS_IMP_ERR = traceback.format_exc()
|
||||
HAS_JENKINS = False
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
@ -171,8 +173,9 @@ def get_jenkins_connection(module):
|
|||
def test_dependencies(module):
|
||||
if not HAS_JENKINS:
|
||||
module.fail_json(
|
||||
msg="python-jenkins required for this module. "
|
||||
"see http://python-jenkins.readthedocs.io/en/latest/install.html")
|
||||
msg=missing_required_lib("python-jenkins",
|
||||
url="https://python-jenkins.readthedocs.io/en/latest/install.html"),
|
||||
exception=JENKINS_IMP_ERR)
|
||||
|
||||
|
||||
def get_jobs(module):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue