Support bash script access for the configuration settings #480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Provide a bash script access for the configuration settings introduced in #383 .
Rationale
set_settings.sh)Changes
Refactored Common Settings Utilities in
set_settings.shtosettings.shExtracted key definitions and utility functions from
set_settings.shinto a new file:tool/config/settings.shset_settings.shupdated to sourcesettings.sh.KEY_DESCRIPTIONS,VALID_KEYS,MAX_KEY_LENGTHprint_key(),show_valid_keys()New Script:
get_settings.shAdded
tool/config/get_settings.shto retrieve a single key’s value from the settings.Supports:
--local,--globalflags for scope controlsettings.shReplaced Old Python Logic with the New Interface
Removed the old
SystemSettingclass inconfigure.py.Added new function:
Calls
get_settings.shdirectly and returns the setting value ordefault_valif not set.Simplifies and unifies how Python retrieves config setting values using the same logic as the shell tools.
Tests
set_settings.shworks the same as before.get_settings.shcould retrieve the values in the correct order.configure.pycan read the default machine as before.