summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMax Cameron <max.cameron@stackboard.co.uk>2018-09-04 14:43:58 +0100
committerSloane Hertel <shertel@redhat.com>2018-09-04 09:43:58 -0400
commitcf1006179d039bba6f8ac48494e4833a82c929ea (patch)
treee27e2c94509951bb7f7d333cf9529bf9ffe8ff5e /contrib
parent324b57d6ae3e2b0141f6927fe689959654e78b33 (diff)
downloadansible-cf1006179d039bba6f8ac48494e4833a82c929ea.tar.gz
Fixes ec2.py assume_role. (#37357)
* Fixes ec2.py assume_role Previously when connect_to_aws was called it updated the credentials in place. "connect_to_aws" is called multiple times: on the second run it tries to assume the same role it is already using, and potentially failing depending on your iam policies.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/inventory/ec2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py
index 45619c2ac3..b5108d3756 100755
--- a/contrib/inventory/ec2.py
+++ b/contrib/inventory/ec2.py
@@ -159,6 +159,7 @@ import os
import argparse
import re
from time import time
+from copy import deepcopy
import boto
from boto import ec2
from boto import rds
@@ -569,7 +570,7 @@ class Ec2Inventory(object):
return connect_args
def connect_to_aws(self, module, region):
- connect_args = self.credentials
+ connect_args = deepcopy(self.credentials)
# only pass the profile name if it's set (as it is not supported by older boto versions)
if self.boto_profile: