summaryrefslogtreecommitdiff
path: root/src/buildstream/sandbox
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-02-25 17:48:55 +0100
committerJürg Billeter <j@bitron.ch>2020-02-27 12:18:07 +0100
commit0f80285901d59e67767bbf498f92bc2daa9720df (patch)
tree58cb15b8f012fa82f3caad9c9d6a3ce6ba6e9bd4 /src/buildstream/sandbox
parentcef76e3e38c51fc67e137199f7cd959b7ceaf52e (diff)
downloadbuildstream-0f80285901d59e67767bbf498f92bc2daa9720df.tar.gz
_sandboxreapi.py: Support optional network access
This is used by `bst shell`.
Diffstat (limited to 'src/buildstream/sandbox')
-rw-r--r--src/buildstream/sandbox/_sandboxbuildboxrun.py2
-rw-r--r--src/buildstream/sandbox/_sandboxreapi.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/buildstream/sandbox/_sandboxbuildboxrun.py b/src/buildstream/sandbox/_sandboxbuildboxrun.py
index df2c4394d..df0703dfd 100644
--- a/src/buildstream/sandbox/_sandboxbuildboxrun.py
+++ b/src/buildstream/sandbox/_sandboxbuildboxrun.py
@@ -173,7 +173,7 @@ class SandboxBuildBoxRun(SandboxREAPI):
raise SandboxError("buildbox-run failed with returncode {}".format(returncode))
def _supported_platform_properties(self):
- return {"unixUID", "unixGID"}
+ return {"unixUID", "unixGID", "network"}
def _warn(self, msg):
self._get_context().messenger.message(Message(MessageType.WARN, msg))
diff --git a/src/buildstream/sandbox/_sandboxreapi.py b/src/buildstream/sandbox/_sandboxreapi.py
index 774058d6a..19c599197 100644
--- a/src/buildstream/sandbox/_sandboxreapi.py
+++ b/src/buildstream/sandbox/_sandboxreapi.py
@@ -121,6 +121,9 @@ class SandboxREAPI(Sandbox):
if "unixGID" in supported_properties:
platform.properties.add(name="unixGID", value=str(gid))
+ if flags & SandboxFlags.NETWORK_ENABLED and "network" in supported_properties:
+ platform.properties.add(name="network", value="on")
+
return remote_execution_pb2.Command(
arguments=command,
working_directory=working_directory[1:],