From 719730e534ec0c8e3a3bf155e5b9ae36cf5a261e Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Fri, 13 Mar 2020 15:57:11 -0400 Subject: [PATCH] Stop comparing hostnames to determine ownership We shouldn't need to compare hostnames at this point since that was an artifact of maintaining compatibility with existing ZK data before we added unique build host IDs. That data should long since be gone everywhere. Change-Id: Ia94f20b15ab9cf2ae4969891eedccec8d5291d36 --- nodepool/builder.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/nodepool/builder.py b/nodepool/builder.py index 26cfc5782..ba5e63986 100644 --- a/nodepool/builder.py +++ b/nodepool/builder.py @@ -388,11 +388,7 @@ class CleanupWorker(BaseWorker): '''Return the subset of builds that are local''' ret = [] for build in builds: - # To maintain backward compatibility with builders that didn't - # use unique builder IDs before, but do now, always compare to - # hostname as well since some ZK data may still reference that. - is_local = build.builder_id == self._builder_id or \ - build.builder == self._hostname + is_local = build.builder_id == self._builder_id if is_local: ret.append(build) return ret @@ -510,12 +506,8 @@ class CleanupWorker(BaseWorker): # provider uploads are in a deleting state. This prevents us from # keeping local files around while we wait on clouds to remove # the image on their side (which can be very slow). - # To maintain backward compatibility with builders that didn't - # use unique builder IDs before, but do now, always compare to - # hostname as well since some ZK data may still reference that. all_deleting = all(map(lambda x: x.state == zk.DELETING, uploads)) - is_local = build.builder_id == self._builder_id or \ - build.builder == self._hostname + is_local = build.builder_id == self._builder_id if (not uploads or all_deleting) and is_local: self._deleteLocalBuild(image, build)