fix improt order to actually skip when no boto

pull/28791/head
Brian Coca 7 years ago
parent 883aede8ac
commit aec1dfd1fa

@ -20,8 +20,6 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
import ansible.modules.cloud.amazon.lambda_policy as lambda_policy
from ansible.modules.cloud.amazon.lambda_policy import setup_module_object
from ansible.module_utils.aws.core import HAS_BOTO3 from ansible.module_utils.aws.core import HAS_BOTO3
from ansible.module_utils import basic from ansible.module_utils import basic
from ansible.module_utils.basic import to_bytes from ansible.module_utils.basic import to_bytes
@ -29,15 +27,14 @@ from ansible.compat.tests.mock import MagicMock
import json import json
import copy import copy
from botocore.exceptions import ClientError
# try:
# from botocore import ResourceNotFoundException
# except:
# pass # will be protected by HAS_BOTO3
if not HAS_BOTO3: if not HAS_BOTO3:
raise SkipTest("test_api_gateway.py requires the `boto3` and `botocore` modules") raise SkipTest("test_api_gateway.py requires the `boto3` and `botocore` modules")
# these are here cause ... boto!
from botocore.exceptions import ClientError
import ansible.modules.cloud.amazon.lambda_policy as lambda_policy
from ansible.modules.cloud.amazon.lambda_policy import setup_module_object
base_module_args = { base_module_args = {
"region": "us-west-1", "region": "us-west-1",
"function_name": "this_is_a_test_function", "function_name": "this_is_a_test_function",

Loading…
Cancel
Save