summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2018-12-19 17:43:56 +0000
committerAngelos Evripiotis <angelos.evripiotis@gmail.com>2018-12-20 13:59:23 +0000
commit7368f569e1fcb0dc8b765e43c811ac314ca5bfbd (patch)
tree835f25767224eb5adbaa0f7f99cba7b0a4292965
parent14da6955f9dd7ed820992a49af3eda8fe8092890 (diff)
downloadbuildstream-7368f569e1fcb0dc8b765e43c811ac314ca5bfbd.tar.gz
_project::_find_project_dir: fix error message
Now that we are also looking for WORKSPACE_PROJECT_FILE, we should add it to the error message. While we're there, also mention the directory we are looking in - this could help scripters be clear about what went wrong. The new error message looks like this: Error loading project: None of ['project.conf', '.bstproject.yaml'] found in '/src/temp/blah' or any of its parent directories
-rw-r--r--buildstream/_project.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index 90ed58e14..ef8d835cf 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -677,8 +677,9 @@ class Project():
#
def _find_project_dir(self, directory):
workspace_element = None
+ config_filenames = [_PROJECT_CONF_FILE, WORKSPACE_PROJECT_FILE]
found_directory, filename = utils._search_upward_for_files(
- directory, [_PROJECT_CONF_FILE, WORKSPACE_PROJECT_FILE]
+ directory, config_filenames
)
if filename == _PROJECT_CONF_FILE:
project_directory = found_directory
@@ -691,8 +692,8 @@ class Project():
else:
raise LoadError(
LoadErrorReason.MISSING_PROJECT_CONF,
- '{} not found in current directory or any of its parent directories'
- .format(_PROJECT_CONF_FILE))
+ "None of {names} found in '{path}' or any of its parent directories"
+ .format(names=config_filenames, path=directory))
return project_directory, workspace_element