diff options
-rwxr-xr-x | inventory/multi_ec2.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inventory/multi_ec2.py b/inventory/multi_ec2.py index 6085a1aef..7fbfb0c90 100755 --- a/inventory/multi_ec2.py +++ b/inventory/multi_ec2.py @@ -106,7 +106,7 @@ class MultiEc2(object): self.results[result['name']] = json.loads(result['out']) values = self.results.values() values.insert(0, self.result) - map(lambda x: self.merge(self.result, x), values) + map(lambda x: self.merge_destructively(self.result, x), values) else: # For any 0 result, return it count = 0 @@ -117,12 +117,12 @@ class MultiEc2(object): if count > 1: raise RuntimeError("Found > 1 results for --host %s. \ This is an invalid state." % self.args.host) - def merge(self, a, b): + def merge_destructively(self, a, b): "merges b into a" for key in b: if key in a: if isinstance(a[key], dict) and isinstance(b[key], dict): - self.merge(a[key], b[key]) + self.merge_destructively(a[key], b[key]) elif a[key] == b[key]: pass # same leaf value # both lists so add each element in b to a if it does ! exist |