diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-16 18:28:38 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-20 16:55:56 +0900 |
commit | 1fbedea8ce1a32e5e9bb86479add3c24ba8b1f36 (patch) | |
tree | a7b39c3d0a3b31903d85d7a96b681be652036d75 /buildstream/plugins | |
parent | 7777d390c789d8ebaab993fdb6efd0b018ffd541 (diff) | |
download | buildstream-1fbedea8ce1a32e5e9bb86479add3c24ba8b1f36.tar.gz |
_downloadablefilesource.py: Support None values in ref accessors.
Diffstat (limited to 'buildstream/plugins')
-rw-r--r-- | buildstream/plugins/sources/_downloadablefilesource.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/buildstream/plugins/sources/_downloadablefilesource.py b/buildstream/plugins/sources/_downloadablefilesource.py index 39bd48d25..d3b8d49bd 100644 --- a/buildstream/plugins/sources/_downloadablefilesource.py +++ b/buildstream/plugins/sources/_downloadablefilesource.py @@ -37,9 +37,16 @@ class DownloadableFileSource(Source): return Consistency.RESOLVED def get_ref(self): + # Report `None` value if we dont have a ref + if self.ref is None: + return None return (self.ref, self.etag) def set_ref(self, ref, node): + # Always support `None` value for ref + if ref is None: + ref = (None, None) + self.ref, self.etag = ref node['ref'] = self.ref |