summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-07-19 11:55:45 +0100
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-07-19 11:55:45 +0100
commitd98e8ceb220f3ab4affb2b22d350c43c9f06f289 (patch)
treea4c1cb40fd806234825eac8bdbcdc8804ce46d97
parentfab331624359caa642bf254214a5caf8e27f26e4 (diff)
downloadbuildstream-d98e8ceb220f3ab4affb2b22d350c43c9f06f289.tar.gz
Handle case of descending through a symlink with a unimplemented error
-rw-r--r--buildstream/storage/_casbaseddirectory.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 368c42c9d..7339f9c41 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -227,9 +227,14 @@ class CasBasedDirectory(Directory):
return self.descend(subdirectory_spec[1:], create)
if subdirectory_spec[0] in self.index:
- entry = self.index[subdirectory_spec[0]].buildstream_object
- if isinstance(entry, CasBasedDirectory):
- return entry.descend(subdirectory_spec[1:], create)
+ entry1 = self.index[subdirectory_spec[0]].pb2_object
+ entry2 = self.index[subdirectory_spec[0]].buildstream_object
+ if isinstance(entry2, CasBasedDirectory):
+ return entry2.descend(subdirectory_spec[1:], create)
+ elif isinstance(entry1, remote_execution_pb2.SymlinkNode):
+ # TODO: implement descend through symlink. To do this, we may need to look
+ # upwards, or to the root.
+ raise VirtualDirectoryError("Descend through symlink is not implemented")
else:
error = "Cannot descend into {}, which is a '{}' in the directory {}"
raise VirtualDirectoryError(error.format(subdirectory_spec[0],