diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-02-20 20:32:21 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-16 17:21:15 +0900 |
commit | 9543d0784975c1623b543379207a31b118026418 (patch) | |
tree | 92ec1f68009e63c4b0001efa9131dd992794c952 /buildstream/_project.py | |
parent | 3861de9bc600a4ed24b1fc3c74133848e3d2a7e7 (diff) | |
download | buildstream-9543d0784975c1623b543379207a31b118026418.tar.gz |
_project.py and docs: Move defaults into the defaults yaml file
Over time, the _project.py module has regressed into expressing
some defaults only hard coded into the python file instead of
properly exposing their default in the base configuration file
in data/projectconfig.yaml, where the default values can be observed
by users.
This patch rectifies that, and also restructures the relevant
surrounding documentation a bit.
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r-- | buildstream/_project.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py index db0b7aee9..6c71f03d3 100644 --- a/buildstream/_project.py +++ b/buildstream/_project.py @@ -174,7 +174,7 @@ class Project(): self.name = _yaml.node_get(config, str, 'name') self.element_path = os.path.join( self.directory, - _yaml.node_get(config, str, 'element-path', default_value='.') + _yaml.node_get(config, str, 'element-path') ) # Load project options @@ -215,7 +215,7 @@ class Project(): self._ensure_workspace_config_format() # Assert project version - format_version = _yaml.node_get(config, int, 'format-version', default_value=0) + format_version = _yaml.node_get(config, int, 'format-version') if BST_FORMAT_VERSION < format_version: major, minor = utils.get_bst_version() raise LoadError( @@ -293,14 +293,12 @@ class Project(): self._splits = _yaml.node_get(config, Mapping, 'split-rules') # Fail on overlap - self._fail_on_overlap = _yaml.node_get(config, bool, 'fail-on-overlap', - default_value=False) + self._fail_on_overlap = _yaml.node_get(config, bool, 'fail-on-overlap') # Parse shell options - shell_options = _yaml.node_get(config, Mapping, 'shell', default_value={}) + shell_options = _yaml.node_get(config, Mapping, 'shell') _yaml.node_validate(shell_options, ['command', 'environment', 'host-files']) - self._shell_command = _yaml.node_get(shell_options, list, 'command', - default_value=['sh', '-i']) + self._shell_command = _yaml.node_get(shell_options, list, 'command') # Perform environment expansion right away shell_environment = _yaml.node_get(shell_options, Mapping, 'environment', default_value={}) |