Remove wildcard imports and get_exception calls

Fixed module_utils
This commit is contained in:
Toshio Kuratomi 2017-08-11 20:23:17 -07:00
parent 93e1caccb7
commit ac56a2f138
15 changed files with 174 additions and 218 deletions

View file

@ -22,7 +22,7 @@ This module adds shared support for generic cloud modules
In order to use this module, include it as part of a custom
module as shown below.
from ansible.module_utils.cloud import *
from ansible.module_utils.cloud import CloudRetry
The 'cloud' module provides the following common classes:
@ -44,8 +44,6 @@ from functools import wraps
import syslog
import time
from ansible.module_utils.pycompat24 import get_exception
def _exponential_backoff(retries=10, delay=2, backoff=2, max_delay=60):
""" Customizable exponential backoff strategy.
@ -140,8 +138,7 @@ class CloudRetry(object):
for delay in backoff_strategy():
try:
return f(*args, **kwargs)
except Exception:
e = get_exception()
except Exception as e:
if isinstance(e, cls.base_class):
response_code = cls.status_code_from_exception(e)
if cls.found(response_code):