summaryrefslogtreecommitdiff
path: root/buildstream/sandbox/sandbox.py
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-05-08 16:17:50 +0100
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-08-01 13:07:32 +0100
commit42bdce0b2f45607a400b279487e823bea4fe9c70 (patch)
tree58ed46c646b49e2bf112c43b9254dae54c4093fb /buildstream/sandbox/sandbox.py
parentf124dfec64c6d1cda7dd83711f644e91ec16bcfc (diff)
downloadbuildstream-42bdce0b2f45607a400b279487e823bea4fe9c70.tar.gz
sandbox.py: Add function to get virtual directory.
Diffstat (limited to 'buildstream/sandbox/sandbox.py')
-rw-r--r--buildstream/sandbox/sandbox.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/buildstream/sandbox/sandbox.py b/buildstream/sandbox/sandbox.py
index 90b80af2a..80a309c0c 100644
--- a/buildstream/sandbox/sandbox.py
+++ b/buildstream/sandbox/sandbox.py
@@ -30,6 +30,7 @@ See also: :ref:`sandboxing`.
import os
from .._exceptions import ImplError, BstError
+from ..storage._filebaseddirectory import FileBasedDirectory
class SandboxFlags():
@@ -121,6 +122,20 @@ class Sandbox():
else:
raise BstError("You can't use get_directory")
+ def get_virtual_directory(self):
+ """Fetches the sandbox root directory
+
+ The root directory is where artifacts for the base
+ runtime environment should be staged. Only works if
+ BST_VIRTUAL_DIRECTORY is not set.
+
+ Returns:
+ (str): The sandbox root directory
+
+ """
+ # For now, just create a new Directory every time we're asked
+ return FileBasedDirectory(self._root)
+
def set_environment(self, environment):
"""Sets the environment variables for the sandbox