From d8ccf2a6b937f53e4f564102d4e7f009ade1e26a Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 12 Dec 2014 20:07:49 -0500 Subject: Updated the function name to accurately reflect its procedure. --- inventory/multi_ec2.py | 6 +++--- 1 file 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 -- cgit v1.2.3