From d4449d082e01de224e2b5f6b00b11216829ef6ee Mon Sep 17 00:00:00 2001 From: astro44 Date: Wed, 25 Jan 2017 15:19:38 -0500 Subject: [PATCH] resource overriden when conn_type='both' (#20206) Simple change to avoid resource override when using conn_type == 'both' --- lib/ansible/module_utils/ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index 4c93221e176..50de61ea28c 100755 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -113,8 +113,8 @@ def _boto3_conn(conn_type=None, resource=None, region=None, endpoint=None, **par client = boto3.session.Session(profile_name=profile).client(resource, region_name=region, endpoint_url=endpoint, **params) return client else: - resource = boto3.session.Session(profile_name=profile).resource(resource, region_name=region, endpoint_url=endpoint, **params) client = boto3.session.Session(profile_name=profile).client(resource, region_name=region, endpoint_url=endpoint, **params) + resource = boto3.session.Session(profile_name=profile).resource(resource, region_name=region, endpoint_url=endpoint, **params) return client, resource boto3_inventory_conn = _boto3_conn