Remove deprecated get_exception API

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-12-26 08:33:21 +05:30 committed by Brian Coca
commit 6bd0fbb63c
42 changed files with 284 additions and 409 deletions

View file

@ -103,7 +103,7 @@ EXAMPLES = """
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.junos.junos import junos_argument_spec, get_param
from ansible.module_utils.pycompat24 import get_exception
from ansible.module_utils._text import to_native
try:
from jnpr.junos import Device
@ -134,9 +134,8 @@ def connect(module):
device = Device(host, **kwargs)
device.open()
device.timeout = get_param(module, 'timeout') or 10
except ConnectError:
exc = get_exception()
module.fail_json(msg='unable to connect to %s: %s' % (host, str(exc)))
except ConnectError as exc:
module.fail_json(msg='unable to connect to %s: %s' % (host, to_native(exc)))
return device