Merge pull request #990 from bobo333/recursive_emr_settings
Add support for recursive emr settings
This commit is contained in:
commit
1c4960f6e1
@ -414,6 +414,9 @@ class _RecursiveDictRef(object):
|
|||||||
def __getattr__(self, key):
|
def __getattr__(self, key):
|
||||||
return self.dic.__getattr__(key)
|
return self.dic.__getattr__(key)
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return self.dic.__getitem__(key)
|
||||||
|
|
||||||
def set_reference(self, key, dic):
|
def set_reference(self, key, dic):
|
||||||
"""Set the RecursiveDictRef object to keep reference to dict object
|
"""Set the RecursiveDictRef object to keep reference to dict object
|
||||||
(dic) at the key.
|
(dic) at the key.
|
||||||
|
@ -64,7 +64,18 @@ def test_describe_cluster():
|
|||||||
args['Configurations'] = [
|
args['Configurations'] = [
|
||||||
{'Classification': 'yarn-site',
|
{'Classification': 'yarn-site',
|
||||||
'Properties': {'someproperty': 'somevalue',
|
'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']['AdditionalMasterSecurityGroups'] = ['additional-master']
|
||||||
args['Instances']['AdditionalSlaveSecurityGroups'] = ['additional-slave']
|
args['Instances']['AdditionalSlaveSecurityGroups'] = ['additional-slave']
|
||||||
args['Instances']['Ec2KeyName'] = 'mykey'
|
args['Instances']['Ec2KeyName'] = 'mykey'
|
||||||
@ -87,6 +98,10 @@ def test_describe_cluster():
|
|||||||
config['Classification'].should.equal('yarn-site')
|
config['Classification'].should.equal('yarn-site')
|
||||||
config['Properties'].should.equal(args['Configurations'][0]['Properties'])
|
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 = cl['Ec2InstanceAttributes']
|
||||||
attrs['AdditionalMasterSecurityGroups'].should.equal(
|
attrs['AdditionalMasterSecurityGroups'].should.equal(
|
||||||
args['Instances']['AdditionalMasterSecurityGroups'])
|
args['Instances']['AdditionalMasterSecurityGroups'])
|
||||||
|
Loading…
Reference in New Issue
Block a user