Merge pull request #990 from bobo333/recursive_emr_settings

Add support for recursive emr settings
This commit is contained in:
Jack Danger 2017-06-27 13:32:52 -07:00 committed by GitHub
commit 1c4960f6e1
2 changed files with 19 additions and 1 deletions

View File

@ -414,6 +414,9 @@ class _RecursiveDictRef(object):
def __getattr__(self, key):
return self.dic.__getattr__(key)
def __getitem__(self, key):
return self.dic.__getitem__(key)
def set_reference(self, key, dic):
"""Set the RecursiveDictRef object to keep reference to dict object
(dic) at the key.

View File

@ -64,7 +64,18 @@ def test_describe_cluster():
args['Configurations'] = [
{'Classification': 'yarn-site',
'Properties': {'someproperty': 'somevalue',
'someotherproperty': 'someothervalue'}}]
'someotherproperty': 'someothervalue'}},
{'Classification': 'nested-configs',
'Properties': {},
'Configurations': [
{
'Classification': 'nested-config',
'Properties': {
'nested-property': 'nested-value'
}
}
]}
]
args['Instances']['AdditionalMasterSecurityGroups'] = ['additional-master']
args['Instances']['AdditionalSlaveSecurityGroups'] = ['additional-slave']
args['Instances']['Ec2KeyName'] = 'mykey'
@ -87,6 +98,10 @@ def test_describe_cluster():
config['Classification'].should.equal('yarn-site')
config['Properties'].should.equal(args['Configurations'][0]['Properties'])
nested_config = cl['Configurations'][1]
nested_config['Classification'].should.equal('nested-configs')
nested_config['Properties'].should.equal(args['Configurations'][1]['Properties'])
attrs = cl['Ec2InstanceAttributes']
attrs['AdditionalMasterSecurityGroups'].should.equal(
args['Instances']['AdditionalMasterSecurityGroups'])