Comment 4 for bug 1212354

Revision history for this message
Alexander Ignatov (aignatov) wrote :

This is not a plugin issue. I've reproduced and debug this issue following all steps in bug description.

So, when user erases some default value of some priority 1 field in the UI this value becomes "None" and is sent to the savanna as 'None'. And If you'll try, for example, to erase 'dfs.replication' field savanna will receive the following 'cluster_configs' field in the REST call body:
cluster_configs: {u'HDFS': {u'dfs.replication': None}, u'MapReduce': {}, u'general': {}}

Which leads to the validation error

2014-02-11 01:26:24.629 77319 DEBUG savanna.utils.api [-] Validation Error occurred: error_code=400, error_message={u'HDFS': {u'dfs.replication': None}, u'MapReduce': {}, u'general': {}} is not of type 'configs', error_name=VALIDATION_ERROR bad_request /Users/aignatov/work/savanna/savanna/utils/api.py:238

Validation check fails because savanna expects hadoop configs to be String, Integer or Boolean:
https://github.com/openstack/savanna/blob/master/savanna/utils/api_validator.py#L103-L106

And None value cannot be interpreted correctly.

So I think Savanna's behaviour in that situation is correct right now because we cann't pass None fields as hadoop parameters.
And solution would be to check None values on the UI side before sending creation request and substitute Nones with defaults.
Another solution is to send Nones to savanna and savanna itself will replace it with defaults