summaryrefslogtreecommitdiff
path: root/buildstream/element.py
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-05-11 17:48:28 +0100
committerChandan Singh <csingh43@bloomberg.net>2018-05-17 11:40:20 +0100
commitba6eaba60a09f1c1e30145fdbe4b82161bb341a6 (patch)
tree43b2c997f2fcbb9bbc955c07aeb8a74b730c1e47 /buildstream/element.py
parente023beb56b180316a58f409d48f158e9dc1ece95 (diff)
downloadbuildstream-chandan/393-fix-workspace-no-reference.tar.gz
element.py: Fix consistency of workspaced elements when ref is missingchandan/393-fix-workspace-no-reference
Fixes #393.
Diffstat (limited to 'buildstream/element.py')
-rw-r--r--buildstream/element.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 70bee42e6..90cdec640 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1864,17 +1864,11 @@ class Element(Plugin):
if self.__tracking_scheduled:
return
- # Determine overall consistency of the element
- consistency = Consistency.CACHED
- for source in self.__sources:
- source._update_state()
- source_consistency = source._get_consistency()
- consistency = min(consistency, source_consistency)
- self.__consistency = consistency
+ self.__consistency = Consistency.CACHED
+ workspace = self._get_workspace()
# Special case for workspaces
- workspace = self._get_workspace()
- if workspace and self.__consistency > Consistency.INCONSISTENT:
+ if workspace:
# A workspace is considered inconsistent in the case
# that it's directory went missing
@@ -1882,6 +1876,13 @@ class Element(Plugin):
fullpath = workspace.get_absolute_path()
if not os.path.exists(fullpath):
self.__consistency = Consistency.INCONSISTENT
+ else:
+
+ # Determine overall consistency of the element
+ for source in self.__sources:
+ source._update_state()
+ source_consistency = source._get_consistency()
+ self.__consistency = min(self.__consistency, source_consistency)
# __calculate_cache_key():
#