diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-28 16:14:29 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-28 16:14:29 +0000 |
commit | 698a77d97c534c2a7180bfa21aba4d6446d56ebc (patch) | |
tree | f453f3738e8bc839f00f23ebce844ea57639deaf /run-sandbox | |
parent | d9fc911053945a77a994116d5ac1bbe4f3b67100 (diff) | |
download | sandboxlib-698a77d97c534c2a7180bfa21aba4d6446d56ebc.tar.gz |
Don't have a 'base' environment, make the caller specify 'env'
The idea with 'extra_env' was that all 'sandboxlib' sandboxes would have
a consistent base environment with standard PATH, etc. But that's not
really workable at all, and only PATH actually matters here anyway.
Now the caller passes in the entire environment as 'env', 'extra_env' is
gone.
Diffstat (limited to 'run-sandbox')
-rwxr-xr-x | run-sandbox | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/run-sandbox b/run-sandbox index c25a2ff..6bd44c0 100755 --- a/run-sandbox +++ b/run-sandbox @@ -90,12 +90,13 @@ def run(): elif 'workingDirectory' in manifest['app']: cwd = manifest['app']['workingDirectory'] - extra_env = {} + env = sandboxlib.load.appc.BASE_ENVIRONMENT.copy() + if 'environment' in manifest['app']: for item in manifest['app']['environment']: - extra_env[item['name']] = item['value'] + env[item['name']] = item['value'] - extra_env['AC_APP_NAME'] = manifest['name'] + env['AC_APP_NAME'] = manifest['name'] sharing_config = executor.maximum_possible_isolation() @@ -104,7 +105,7 @@ def run(): ] exit, out, err = executor.run_sandbox( - rootfs_path, command, cwd=cwd, extra_env=extra_env, + rootfs_path, command, cwd=cwd, env=env, extra_mounts=extra_mounts, **sharing_config) # We'll take a punt on the output being valid UTF-8. |