diff options
author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-05-08 16:14:37 +0100 |
---|---|---|
committer | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-08-01 13:07:32 +0100 |
commit | 4397e45ad061acfcb8258a382163b051f7e421e6 (patch) | |
tree | 53d8a46e95a7dbd99c67509016b41f9dcc464602 /buildstream/sandbox/sandbox.py | |
parent | 1d3af84d312b5c252630637d01502c4625416348 (diff) | |
download | buildstream-4397e45ad061acfcb8258a382163b051f7e421e6.tar.gz |
Sandbox.py: Rename __root to _root.
This is to allow to allow its use by subclasses.
Since access to get_directories is now blocked for some plugins,
and the subclasses of Sandbox do not have configuration defined
by YAML files, they need another way to get at the root directory.
Diffstat (limited to 'buildstream/sandbox/sandbox.py')
-rw-r--r-- | buildstream/sandbox/sandbox.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/buildstream/sandbox/sandbox.py b/buildstream/sandbox/sandbox.py index 7e73e0d9a..90b80af2a 100644 --- a/buildstream/sandbox/sandbox.py +++ b/buildstream/sandbox/sandbox.py @@ -97,11 +97,12 @@ class Sandbox(): self.__stdout = kwargs['stdout'] self.__stderr = kwargs['stderr'] - # Setup the directories + # Setup the directories. Root should be available to subclasses, hence + # being single-underscore. The others are private to this class. + self._root = os.path.join(directory, 'root') self.__directory = directory - self.__root = os.path.join(self.__directory, 'root') self.__scratch = os.path.join(self.__directory, 'scratch') - for directory_ in [self.__root, self.__scratch]: + for directory_ in [self._root, self.__scratch]: os.makedirs(directory_, exist_ok=True) def get_directory(self): @@ -116,7 +117,7 @@ class Sandbox(): """ if self.__allow_real_directory: - return self.__root + return self._root else: raise BstError("You can't use get_directory") |