summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2018-07-31 12:44:31 +0100
committerTiago Gomes <tiago.gomes@codethink.co.uk>2018-08-02 12:33:17 +0100
commit99ca4b77a7cba97d695b2183737f77d6ff33d4b7 (patch)
treecd0b0accd4b67c5263e9e806d22dd68cb011684f
parentea9fd3dd85c0fd70eecb2afc1fc55e3a0140b32e (diff)
downloadbuildstream-99ca4b77a7cba97d695b2183737f77d6ff33d4b7.tar.gz
project: validate project paths (element-path)
-rw-r--r--buildstream/_project.py4
-rw-r--r--tests/artifactcache/expiry.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index 1c30fb9bb..b761d650f 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -16,6 +16,7 @@
#
# Authors:
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
+# Tiago Gomes <tiago.gomes@codethink.co.uk>
import os
import multiprocessing # for cpu_count()
@@ -291,7 +292,8 @@ class Project():
self.element_path = os.path.join(
self.directory,
- _yaml.node_get(config, str, 'element-path')
+ _yaml.node_get_project_path(config, 'element-path', self.directory,
+ check_is_dir=True)
)
# Load project options
diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py
index 62c066605..9c74eb1c4 100644
--- a/tests/artifactcache/expiry.py
+++ b/tests/artifactcache/expiry.py
@@ -234,7 +234,7 @@ def test_never_delete_dependencies(cli, datafiles, tmpdir):
@pytest.mark.datafiles(DATA_DIR)
def test_invalid_cache_quota(cli, datafiles, tmpdir, quota, success):
project = os.path.join(datafiles.dirname, datafiles.basename)
- element_path = os.path.join(project, 'elements')
+ os.makedirs(os.path.join(project, 'elements'))
cli.configure({
'cache': {