summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-05-10 13:45:28 +0200
committerJürg Billeter <j@bitron.ch>2018-05-11 07:57:37 +0200
commite1420437a2d82af099bdb3d273823effbea35ce4 (patch)
tree0399211c6df654ad4bce32fd917b3a08a1532a5b
parentb2b365fbd4adfdb3e44833a30f446c2f747c9119 (diff)
downloadbuildstream-e1420437a2d82af099bdb3d273823effbea35ce4.tar.gz
_artifactcache/ostreecache.py: Fix global remotes
Counter-intuitively, Python list += mutates the list. Use explicit copy() and extend() instead of += to avoid adding project-specific remotes to the global remote list.
-rw-r--r--buildstream/_artifactcache/ostreecache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/ostreecache.py b/buildstream/_artifactcache/ostreecache.py
index 39e7efb34..97e9088a5 100644
--- a/buildstream/_artifactcache/ostreecache.py
+++ b/buildstream/_artifactcache/ostreecache.py
@@ -210,10 +210,10 @@ class OSTreeCache(ArtifactCache):
return any_pushed
def initialize_remotes(self, *, on_failure=None):
- remote_specs = self.global_remote_specs
+ remote_specs = self.global_remote_specs.copy()
for project in self.project_remote_specs:
- remote_specs += self.project_remote_specs[project]
+ remote_specs.extend(self.project_remote_specs[project])
remote_specs = list(utils._deduplicate(remote_specs))