diff options
| author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-06-04 10:19:55 +0100 |
|---|---|---|
| committer | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-07-24 13:17:50 +0100 |
| commit | 357c3995a44cd38eedd8016a0512a46f76680e90 (patch) | |
| tree | 72a296479e11088867b8e4da8adb800054e4f77f | |
| parent | df124e4566d08becf40d4cebf245c677f4b041d2 (diff) | |
| download | buildstream-357c3995a44cd38eedd8016a0512a46f76680e90.tar.gz | |
Convert uses of external_directory to get_underlying_directory()
| -rw-r--r-- | buildstream/sandbox/_mount.py | 2 | ||||
| -rw-r--r-- | buildstream/sandbox/_sandboxbwrap.py | 2 | ||||
| -rw-r--r-- | buildstream/storage/_filebaseddirectory.py | 5 | ||||
| -rw-r--r-- | buildstream/storage/directory.py | 6 |
4 files changed, 13 insertions, 2 deletions
diff --git a/buildstream/sandbox/_mount.py b/buildstream/sandbox/_mount.py index 0f96a92b7..64b256a59 100644 --- a/buildstream/sandbox/_mount.py +++ b/buildstream/sandbox/_mount.py @@ -33,7 +33,7 @@ class Mount(): def __init__(self, sandbox, mount_point, safe_hardlinks): scratch_directory = sandbox._get_scratch_directory() # Getting external_directory here is acceptable as we're part of the sandbox code. - root_directory = sandbox.get_virtual_directory().external_directory + root_directory = sandbox.get_virtual_directory().get_underlying_directory() self.mount_point = mount_point self.safe_hardlinks = safe_hardlinks diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py index 010e4791d..79573807c 100644 --- a/buildstream/sandbox/_sandboxbwrap.py +++ b/buildstream/sandbox/_sandboxbwrap.py @@ -58,7 +58,7 @@ class SandboxBwrap(Sandbox): stdout, stderr = self._get_output() # Allowable access to underlying storage as we're part of the sandbox - root_directory = self.get_virtual_directory().external_directory + root_directory = self.get_virtual_directory().get_underlying_directory() # Fallback to the sandbox default settings for # the cwd and env. diff --git a/buildstream/storage/_filebaseddirectory.py b/buildstream/storage/_filebaseddirectory.py index 91bb7763c..1f2b16cdf 100644 --- a/buildstream/storage/_filebaseddirectory.py +++ b/buildstream/storage/_filebaseddirectory.py @@ -230,3 +230,8 @@ class FileBasedDirectory(Directory): # which exposes the sandbox directory; we will have to assume for the time being # that people will not abuse __str__. return self.external_directory + + def get_underlying_directory(self) -> str: + """ Returns the underlying (real) file system directory this + object refers to. """ + return self.external_directory diff --git a/buildstream/storage/directory.py b/buildstream/storage/directory.py index f70863f77..e62bd3e27 100644 --- a/buildstream/storage/directory.py +++ b/buildstream/storage/directory.py @@ -153,3 +153,9 @@ class Directory(): """ raise NotImplementedError() + + def get_underlying_directory(self) -> str: + """ Returns the underlying (real) file system directory this + object refers to. This will throw an exception if there isn't + a real directory behind the object. """ + raise NotImplementedError() |
