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:
Jordan Borean 2019-02-08 10:07:01 +10:00 committed by GitHub
parent ffbc9d99de
commit a39c4ad464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 292 additions and 150 deletions

View file

@ -9,13 +9,17 @@ __metaclass__ = type
import os
import sys
import time
import traceback
from ansible.module_utils._text import to_text, to_native
from ansible.module_utils.basic import missing_required_lib
CS_IMP_ERR = None
try:
from cs import CloudStack, CloudStackException, read_config
HAS_LIB_CS = True
except ImportError:
CS_IMP_ERR = traceback.format_exc()
HAS_LIB_CS = False
CS_HYPERVISORS = [
@ -53,7 +57,7 @@ class AnsibleCloudStack:
def __init__(self, module):
if not HAS_LIB_CS:
module.fail_json(msg="python library cs required: pip install cs")
module.fail_json(msg=missing_required_lib('cs'), exception=CS_IMP_ERR)
self.result = {
'changed': False,