summaryrefslogtreecommitdiffstats
path: root/inventory
diff options
context:
space:
mode:
authorMatt Woodson <mwoodson@gmail.com>2015-11-02 12:36:49 -0500
committerMatt Woodson <mwoodson@gmail.com>2015-11-02 12:36:49 -0500
commita706860af853be6d8bc77ea38593467e827ed527 (patch)
treeaaaa4997ba9da249ef09f2f509b4b1a25500993c /inventory
parent5758fdc75659bdd9a02cc56efb7255d677233ad2 (diff)
parent63b19e964fcc09e60562fd253d725edcc2ec4aef (diff)
downloadopenshift-a706860af853be6d8bc77ea38593467e827ed527.tar.gz
openshift-a706860af853be6d8bc77ea38593467e827ed527.tar.bz2
openshift-a706860af853be6d8bc77ea38593467e827ed527.tar.xz
openshift-a706860af853be6d8bc77ea38593467e827ed527.zip
Merge pull request #790 from openshift/master
Merge master into prod
Diffstat (limited to 'inventory')
-rwxr-xr-xinventory/multi_ec2.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/inventory/multi_ec2.py b/inventory/multi_ec2.py
index 23cf5ecf1..98dde3f3c 100755
--- a/inventory/multi_ec2.py
+++ b/inventory/multi_ec2.py
@@ -241,23 +241,24 @@ class MultiEc2(object):
'''
results = self.all_ec2_results[acc_config['name']]
- # Update each hostvar with the newly desired key: value
- for new_var, value in acc_config.get('extra_vars', {}).items():
- # Verify the account results look sane
- # by checking for these keys ('_meta' and 'hostvars' exist)
- if results.has_key('_meta') and results['_meta'].has_key('hostvars'):
- for data in results['_meta']['hostvars'].values():
- data[str(new_var)] = str(value)
-
- # Add this group
- if results.has_key(acc_config['all_group']):
- results["%s_%s" % (new_var, value)] = \
- copy.copy(results[acc_config['all_group']])
+ # Update each hostvar with the newly desired key: value from extra_*
+ for _extra in ['extra_groups', 'extra_vars']:
+ for new_var, value in acc_config.get(_extra, {}).items():
+ # Verify the account results look sane
+ # by checking for these keys ('_meta' and 'hostvars' exist)
+ if results.has_key('_meta') and results['_meta'].has_key('hostvars'):
+ for data in results['_meta']['hostvars'].values():
+ data[str(new_var)] = str(value)
+
+ # Add this group
+ if _extra == 'extra_groups' and results.has_key(acc_config['all_group']):
+ results["%s_%s" % (new_var, value)] = \
+ copy.copy(results[acc_config['all_group']])
# Clone groups goes here
- for name_from, name_to in acc_config.get('clone_groups', {}).items():
- if results.has_key(name_from):
- results[name_to] = copy.copy(results[name_from])
+ for to_name, from_name in acc_config.get('clone_groups', {}).items():
+ if results.has_key(from_name):
+ results[to_name] = copy.copy(results[from_name])
# Clone vars goes here
for to_name, from_name in acc_config.get('clone_vars', {}).items():