From be6b5564595872c9e6ff54c3d812be1061c0837d Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Tue, 6 Mar 2018 21:04:32 +0900 Subject: Removing all traces of `environment-inherit` shell configuration. This is made redundant by the more complete `environment` configuration, so lets quickly remove the former in this new format version 4. --- buildstream/_project.py | 5 +---- buildstream/element.py | 7 +------ 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'buildstream') diff --git a/buildstream/_project.py b/buildstream/_project.py index 253d5210d..db0b7aee9 100644 --- a/buildstream/_project.py +++ b/buildstream/_project.py @@ -103,7 +103,6 @@ class Project(): # Shell options self._shell_command = [] # The default interactive shell command - self._shell_env_inherit = [] # Environment vars to inherit when non-isolated self._shell_environment = {} # Statically set environment vars self._shell_host_files = [] # A list of HostMount objects @@ -299,11 +298,9 @@ class Project(): # Parse shell options shell_options = _yaml.node_get(config, Mapping, 'shell', default_value={}) - _yaml.node_validate(shell_options, ['command', 'environment-inherit', 'environment', 'host-files']) + _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_env_inherit = _yaml.node_get(shell_options, list, 'environment-inherit', - default_value=[]) # Perform environment expansion right away shell_environment = _yaml.node_get(shell_options, Mapping, 'environment', default_value={}) diff --git a/buildstream/element.py b/buildstream/element.py index ad0e87bcf..394439e37 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1434,12 +1434,7 @@ class Element(Plugin): # flags |= SandboxFlags.NETWORK_ENABLED | SandboxFlags.INHERIT_UID - # Use the project defined list of env vars to inherit - for inherit in project._shell_env_inherit: - if os.environ.get(inherit) is not None: - environment[inherit] = os.environ.get(inherit) - - # Now add in the explicitly set environment variables + # Apply project defined environment vars to set for a shell for key, value in _yaml.node_items(project._shell_environment): environment[key] = value -- cgit v1.2.1