Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
Background : AMBARI-22198 added "stack settings", and AMBARI-22196 introduced "cluster settings" in Ambari.
=========================================================================
Library for querying clusterSettings and stackSettings for its contents in command*.json.
=========================================================================
One should be able to query for a given clusterSettings or stackSettings:
- by passing in the setting name(one or more) in order to get it back as key-value map, or
- just get the value back for a passed-in setting.
Functions for clusterSettings:
-----------------------------------------
- get_cluster_setting_entries(setting_names) :
- Retrieves the passed-in cluster setting entr(y/ies) and their values as a map.
If 'setting_names' is passed-in as None : all the settings names and their corresponding values will be returned as map.
If 'setting_names' is passed-in as empty set : None will be returned.
- Retrieves the passed-in cluster setting entr(y/ies) and their values as a map.
- get_cluster_setting_value(setting_name) :
- Retrieves the passed-in cluster setting entry's value.
- is_security_enabled() :
- Retrieves the cluster's security status.
Functions for stackSettings:
-----------------------------------------
Stack settings as of now has 5 settings : stack_name, stack_root, stack_features, stack_tools, stack_packages. stack_name, stack_root have string as values, whereas stack_features, stack_tools, stack_packages have values as JSON. Further there already exists python functions in files : stack_features.py, stack_tools.py and stack_select.py.
- get_stack_setting_entries(setting_names) :
- Retrieves the passed-in stack setting entr(y/ies) and their values as a map.
If 'setting_names' is passed-in as None, all the settings names and their corresponding values will be returned as map.
If 'setting_names' is passed-in as empty set : None will be returned.
- Retrieves the passed-in stack setting entr(y/ies) and their values as a map.
- get_stack_setting_value(setting_name):
- Retrieves the passed-in stack setting entry's value.
- get_stack_name():
- Retrieves the stack name.
- get_stack_root():
- Retrieves the stack root.
Modifications in stack_features.py, stack_tools.py and stack_select.py files:
--------------------------------------------------------------------------------------------------------------
- Given that these already exist and as of now they read the relevant stack setting from configurations/cluster_env.
- Thus, code has been added to try reading from /stackSettings first by calling the new fn.() get_stack_setting_value(). if setting not found, go for the fall back configurations/cluster_env (which would be removed soon, when we remove cluster_env).