launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27943
[Merge] ~cjwatson/launchpad:rename-slave-status into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:rename-slave-status into launchpad:master with ~cjwatson/launchpad:rename-builder-slave as a prerequisite.
Commit message:
Rename slave_status to worker_status
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/414034
This is used throughout code that interacts with the build farm.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:rename-slave-status into launchpad:master.
diff --git a/lib/lp/buildmaster/interactor.py b/lib/lp/buildmaster/interactor.py
index 674e34f..4d3e08e 100644
--- a/lib/lp/buildmaster/interactor.py
+++ b/lib/lp/buildmaster/interactor.py
@@ -441,8 +441,8 @@ class BuilderInteractor:
raise CannotResumeHost(
"Invalid vm_reset_protocol: %r" % vitals.vm_reset_protocol)
else:
- slave_status = yield slave.status()
- status = slave_status.get('builder_status', None)
+ worker_status = yield slave.status()
+ status = worker_status.get('builder_status', None)
if status == 'BuilderStatus.IDLE':
# This is as clean as we can get it.
return True
@@ -526,36 +526,36 @@ class BuilderInteractor:
return candidate
@staticmethod
- def extractBuildStatus(slave_status):
+ def extractBuildStatus(worker_status):
"""Read build status name.
- :param slave_status: build status dict from BuilderWorker.status.
+ :param worker_status: build status dict from BuilderWorker.status.
:return: the unqualified status name, e.g. "OK".
"""
- status_string = slave_status['build_status']
+ status_string = worker_status['build_status']
lead_string = 'BuildStatus.'
assert status_string.startswith(lead_string), (
"Malformed status string: '%s'" % status_string)
return status_string[len(lead_string):]
@staticmethod
- def extractLogTail(slave_status):
+ def extractLogTail(worker_status):
"""Extract the log tail from a builder status response.
- :param slave_status: build status dict from BuilderWorker.status.
+ :param worker_status: build status dict from BuilderWorker.status.
:return: a text string representing the tail of the build log, or
None if the log tail is unavailable and should be left
unchanged.
"""
- builder_status = slave_status["builder_status"]
+ builder_status = worker_status["builder_status"]
if builder_status == "BuilderStatus.ABORTING":
logtail = "Waiting for slave process to be terminated"
- elif slave_status.get("logtail") is not None:
- # slave_status["logtail"] is an xmlrpc.client.Binary instance,
+ elif worker_status.get("logtail") is not None:
+ # worker_status["logtail"] is an xmlrpc.client.Binary instance,
# and the contents might include invalid UTF-8 due to being a
# fixed number of bytes from the tail of the log. Turn it into
# Unicode as best we can.
- logtail = slave_status.get("logtail").data.decode(
+ logtail = worker_status.get("logtail").data.decode(
"UTF-8", errors="replace")
# PostgreSQL text columns can't contain \0 characters, and since
# we only use this for web UI display purposes there's no point
@@ -567,7 +567,7 @@ class BuilderInteractor:
@classmethod
@defer.inlineCallbacks
- def updateBuild(cls, vitals, slave, slave_status, builder_factory,
+ def updateBuild(cls, vitals, slave, worker_status, builder_factory,
behaviour_factory, manager):
"""Verify the current build job status.
@@ -579,23 +579,23 @@ class BuilderInteractor:
# impossible to get past the cookie check unless the slave
# matches the DB, and this method isn't called unless the DB
# says there's a job.
- builder_status = slave_status['builder_status']
+ builder_status = worker_status['builder_status']
if builder_status in (
'BuilderStatus.BUILDING', 'BuilderStatus.ABORTING'):
- logtail = cls.extractLogTail(slave_status)
+ logtail = cls.extractLogTail(worker_status)
if logtail is not None:
manager.addLogTail(vitals.build_queue.id, logtail)
vitals.build_queue.specific_build.updateStatus(
vitals.build_queue.specific_build.status,
- slave_status=slave_status)
+ worker_status=worker_status)
transaction.commit()
elif builder_status == 'BuilderStatus.WAITING':
# Build has finished. Delegate handling to the build itself.
builder = builder_factory[vitals.name]
behaviour = behaviour_factory(vitals.build_queue, builder, slave)
yield behaviour.handleStatus(
- vitals.build_queue, cls.extractBuildStatus(slave_status),
- slave_status)
+ vitals.build_queue, cls.extractBuildStatus(worker_status),
+ worker_status)
else:
raise AssertionError("Unknown status %s" % builder_status)
diff --git a/lib/lp/buildmaster/interfaces/buildfarmjob.py b/lib/lp/buildmaster/interfaces/buildfarmjob.py
index 9e8d461..cb5b2f7 100644
--- a/lib/lp/buildmaster/interfaces/buildfarmjob.py
+++ b/lib/lp/buildmaster/interfaces/buildfarmjob.py
@@ -210,7 +210,7 @@ class IBuildFarmJobView(Interface):
:param extra: Extra labels to attach to the metric.
"""
- def updateStatus(status, builder=None, slave_status=None,
+ def updateStatus(status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
"""Update job metadata when the build status changes.
diff --git a/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py b/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py
index ea9de3a..a3a2416 100644
--- a/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py
+++ b/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py
@@ -88,10 +88,10 @@ class IBuildFarmJobBehaviour(Interface):
def verifySuccessfulBuild():
"""Check that we are allowed to collect this successful build."""
- def handleStatus(bq, status, slave_status):
+ def handleStatus(bq, status, worker_status):
"""Update the build from a WAITING slave result.
:param bq: The `BuildQueue` currently being processed.
:param status: The tail of the BuildStatus (eg. OK or PACKAGEFAIL).
- :param slave_status: Slave status dict from `BuilderWorker.status`.
+ :param worker_status: Worker status dict from `BuilderWorker.status`.
"""
diff --git a/lib/lp/buildmaster/manager.py b/lib/lp/buildmaster/manager.py
index 1ad0c9d..ba9c3f1 100644
--- a/lib/lp/buildmaster/manager.py
+++ b/lib/lp/buildmaster/manager.py
@@ -588,9 +588,9 @@ class WorkerScanner:
self._cached_build_queue = vitals.build_queue
return self._cached_build_cookie
- def updateVersion(self, vitals, slave_status):
- """Update the DB's record of the slave version if necessary."""
- version = slave_status.get("builder_version")
+ def updateVersion(self, vitals, worker_status):
+ """Update the DB's record of the worker version if necessary."""
+ version = worker_status.get("builder_version")
if version is not None:
version = six.ensure_text(version)
if version != vitals.version:
@@ -619,15 +619,15 @@ class WorkerScanner:
if not vitals.builderok:
lost_reason = '%s is disabled' % vitals.name
else:
- slave_status = yield slave.status()
+ worker_status = yield slave.status()
# Ensure that the slave has the job that we think it
# should.
- slave_cookie = slave_status.get('build_id')
+ worker_cookie = worker_status.get('build_id')
expected_cookie = self.getExpectedCookie(vitals)
- if slave_cookie != expected_cookie:
+ if worker_cookie != expected_cookie:
lost_reason = (
'%s is lost (expected %r, got %r)' % (
- vitals.name, expected_cookie, slave_cookie))
+ vitals.name, expected_cookie, worker_cookie))
if lost_reason is not None:
# The slave is either confused or disabled, so reset and
@@ -645,9 +645,9 @@ class WorkerScanner:
# The slave and DB agree on the builder's state. Scan the
# slave and get the logtail, or collect the build if it's
# ready. Yes, "updateBuild" is a bad name.
- assert slave_status is not None
+ assert worker_status is not None
yield interactor.updateBuild(
- vitals, slave, slave_status, self.builder_factory,
+ vitals, slave, worker_status, self.builder_factory,
self.behaviour_factory, self.manager)
else:
if not vitals.builderok:
@@ -655,12 +655,12 @@ class WorkerScanner:
# We think the builder is idle. If it's clean, dispatch. If
# it's dirty, clean.
if vitals.clean_status == BuilderCleanStatus.CLEAN:
- slave_status = yield slave.status()
- if slave_status.get('builder_status') != 'BuilderStatus.IDLE':
+ worker_status = yield slave.status()
+ if worker_status.get('builder_status') != 'BuilderStatus.IDLE':
raise BuildDaemonIsolationError(
- 'Allegedly clean slave not idle (%r instead)'
- % slave_status.get('builder_status'))
- self.updateVersion(vitals, slave_status)
+ 'Allegedly clean worker not idle (%r instead)'
+ % worker_status.get('builder_status'))
+ self.updateVersion(vitals, worker_status)
if vitals.manual:
# If the builder is in manual mode, don't dispatch
# anything.
diff --git a/lib/lp/buildmaster/model/buildfarmjob.py b/lib/lp/buildmaster/model/buildfarmjob.py
index 181be99..807854b 100644
--- a/lib/lp/buildmaster/model/buildfarmjob.py
+++ b/lib/lp/buildmaster/model/buildfarmjob.py
@@ -193,7 +193,7 @@ class BuildFarmJobMixin:
labels.update(extra)
getUtility(IStatsdClient).incr("build.%s" % metric_name, labels=labels)
- def updateStatus(self, status, builder=None, slave_status=None,
+ def updateStatus(self, status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
"""See `IBuildFarmJob`."""
diff --git a/lib/lp/buildmaster/model/buildfarmjobbehaviour.py b/lib/lp/buildmaster/model/buildfarmjobbehaviour.py
index 4c91cb8..3ed2e91 100644
--- a/lib/lp/buildmaster/model/buildfarmjobbehaviour.py
+++ b/lib/lp/buildmaster/model/buildfarmjobbehaviour.py
@@ -262,7 +262,7 @@ class BuildFarmJobBehaviourBase:
ALLOWED_STATUS_NOTIFICATIONS = ['PACKAGEFAIL', 'CHROOTFAIL']
@defer.inlineCallbacks
- def handleStatus(self, bq, status, slave_status):
+ def handleStatus(self, bq, status, worker_status):
"""See `IBuildFarmJobBehaviour`."""
if bq != self.build.buildqueue_record:
raise AssertionError(
@@ -290,7 +290,7 @@ class BuildFarmJobBehaviourBase:
# here and the commit can cause duplicated results. For
# example, a BinaryPackageBuild will end up in the upload
# queue twice if notify() crashes.
- build_status = yield self.handleSuccess(slave_status, logger)
+ build_status = yield self.handleSuccess(worker_status, logger)
elif status in fail_status_map:
# XXX wgrant: The builder should be set long before here, but
# currently isn't.
@@ -309,7 +309,7 @@ class BuildFarmJobBehaviourBase:
self.build.updateStatus(
build_status,
builder=self.build.buildqueue_record.builder,
- slave_status=slave_status)
+ worker_status=worker_status)
if notify:
self.build.notify()
self.build.buildqueue_record.destroySelf()
@@ -332,7 +332,7 @@ class BuildFarmJobBehaviourBase:
yield self._slave.getFiles(filenames_to_download, logger=logger)
@defer.inlineCallbacks
- def handleSuccess(self, slave_status, logger):
+ def handleSuccess(self, worker_status, logger):
"""Handle a package that built successfully.
Once built successfully, we pull the files, store them in a
@@ -340,7 +340,7 @@ class BuildFarmJobBehaviourBase:
uploader.
"""
build = self.build
- filemap = slave_status['filemap']
+ filemap = worker_status['filemap']
# If this is a binary package build, discard it if its source is
# no longer published.
diff --git a/lib/lp/buildmaster/model/packagebuild.py b/lib/lp/buildmaster/model/packagebuild.py
index 1ea37c1..1649d14 100644
--- a/lib/lp/buildmaster/model/packagebuild.py
+++ b/lib/lp/buildmaster/model/packagebuild.py
@@ -47,18 +47,18 @@ class PackageBuildMixin(BuildFarmJobMixin):
"""See `IBuildFarmJob`"""
return self.archive.private
- def updateStatus(self, status, builder=None, slave_status=None,
+ def updateStatus(self, status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
super().updateStatus(
- status, builder=builder, slave_status=slave_status,
+ status, builder=builder, worker_status=worker_status,
date_started=date_started, date_finished=date_finished,
force_invalid_transition=force_invalid_transition)
- if (status == BuildStatus.MANUALDEPWAIT and slave_status is not None
- and slave_status.get('dependencies') is not None):
+ if (status == BuildStatus.MANUALDEPWAIT and worker_status is not None
+ and worker_status.get('dependencies') is not None):
self.dependencies = six.ensure_text(
- slave_status.get('dependencies'))
+ worker_status.get('dependencies'))
else:
self.dependencies = None
diff --git a/lib/lp/buildmaster/tests/mock_workers.py b/lib/lp/buildmaster/tests/mock_workers.py
index 25d314a..4cdc392 100644
--- a/lib/lp/buildmaster/tests/mock_workers.py
+++ b/lib/lp/buildmaster/tests/mock_workers.py
@@ -97,10 +97,10 @@ class OkWorker:
def status(self):
self.call_log.append('status')
- slave_status = {'builder_status': 'BuilderStatus.IDLE'}
+ worker_status = {'builder_status': 'BuilderStatus.IDLE'}
if self.version is not None:
- slave_status['builder_version'] = self.version
- return defer.succeed(slave_status)
+ worker_status['builder_version'] = self.version
+ return defer.succeed(worker_status)
def ensurepresent(self, sha1, url, user=None, password=None):
self.call_log.append(('ensurepresent', url, user, password))
diff --git a/lib/lp/buildmaster/tests/test_interactor.py b/lib/lp/buildmaster/tests/test_interactor.py
index e446c47..ba5fb6e 100644
--- a/lib/lp/buildmaster/tests/test_interactor.py
+++ b/lib/lp/buildmaster/tests/test_interactor.py
@@ -124,16 +124,17 @@ class TestBuilderInteractor(TestCase):
def test_extractBuildStatus_baseline(self):
# extractBuildStatus picks the name of the build status out of a
# dict describing the slave's status.
- slave_status = {'build_status': 'BuildStatus.BUILDING'}
+ worker_status = {'build_status': 'BuildStatus.BUILDING'}
self.assertEqual(
- 'BUILDING', BuilderInteractor.extractBuildStatus(slave_status))
+ 'BUILDING', BuilderInteractor.extractBuildStatus(worker_status))
def test_extractBuildStatus_malformed(self):
# extractBuildStatus errors out when the status string is not
# of the form it expects.
- slave_status = {'build_status': 'BUILDING'}
+ worker_status = {'build_status': 'BUILDING'}
self.assertRaises(
- AssertionError, BuilderInteractor.extractBuildStatus, slave_status)
+ AssertionError, BuilderInteractor.extractBuildStatus,
+ worker_status)
def resumeSlaveHost(self, builder):
vitals = extract_vitals_from_db(builder)
diff --git a/lib/lp/buildmaster/tests/test_manager.py b/lib/lp/buildmaster/tests/test_manager.py
index 657193a..abb12fa 100644
--- a/lib/lp/buildmaster/tests/test_manager.py
+++ b/lib/lp/buildmaster/tests/test_manager.py
@@ -694,7 +694,7 @@ class TestWorkerScannerWithLibrarian(TestCaseWithFactory):
# Mock out the build behaviour's handleSuccess so it doesn't
# try to upload things to the librarian or queue.
- def handleSuccess(self, slave_status, logger):
+ def handleSuccess(self, worker_status, logger):
return BuildStatus.UPLOADING
self.patch(
BinaryPackageBuildBehaviour, 'handleSuccess', handleSuccess)
@@ -1027,7 +1027,7 @@ class TestWorkerScannerWithoutDB(TestCase):
with ExpectedException(
BuildDaemonIsolationError,
- r"Allegedly clean slave not idle \(%r instead\)" %
+ r"Allegedly clean worker not idle \(%r instead\)" %
'BuilderStatus.BUILDING'):
yield scanner.scan()
self.assertEqual(['status'], worker.call_log)
diff --git a/lib/lp/buildmaster/tests/test_packagebuild.py b/lib/lp/buildmaster/tests/test_packagebuild.py
index 8a1b51c..47a5798 100644
--- a/lib/lp/buildmaster/tests/test_packagebuild.py
+++ b/lib/lp/buildmaster/tests/test_packagebuild.py
@@ -41,17 +41,17 @@ class TestPackageBuildMixin(TestCaseWithFactory):
def test_updateStatus_MANUALDEPWAIT_sets_dependencies(self):
# updateStatus sets dependencies for a MANUALDEPWAIT build.
self.package_build.updateStatus(
- BuildStatus.MANUALDEPWAIT, slave_status={'dependencies': 'deps'})
+ BuildStatus.MANUALDEPWAIT, worker_status={'dependencies': 'deps'})
self.assertEqual('deps', self.package_build.dependencies)
self.package_build.updateStatus(
- BuildStatus.MANUALDEPWAIT, slave_status={})
+ BuildStatus.MANUALDEPWAIT, worker_status={})
self.assertEqual(None, self.package_build.dependencies)
def test_updateStatus_unsets_dependencies_for_other_statuses(self):
# updateStatus unsets existing dependencies when transitioning
# to another state.
self.package_build.updateStatus(
- BuildStatus.MANUALDEPWAIT, slave_status={'dependencies': 'deps'})
+ BuildStatus.MANUALDEPWAIT, worker_status={'dependencies': 'deps'})
self.assertEqual('deps', self.package_build.dependencies)
self.package_build.updateStatus(BuildStatus.NEEDSBUILD)
self.assertEqual(None, self.package_build.dependencies)
diff --git a/lib/lp/charms/browser/tests/test_charmrecipebuild.py b/lib/lp/charms/browser/tests/test_charmrecipebuild.py
index cd83dc7..0cbc484 100644
--- a/lib/lp/charms/browser/tests/test_charmrecipebuild.py
+++ b/lib/lp/charms/browser/tests/test_charmrecipebuild.py
@@ -92,7 +92,7 @@ class TestCharmRecipeBuildView(TestCaseWithFactory):
def test_revision_id(self):
build = self.factory.makeCharmRecipeBuild()
build.updateStatus(
- BuildStatus.FULLYBUILT, slave_status={"revision_id": "dummy"})
+ BuildStatus.FULLYBUILT, worker_status={"revision_id": "dummy"})
build_view = create_initialized_view(build, "+index")
self.assertThat(build_view(), soupmatchers.HTMLContains(
soupmatchers.Tag(
diff --git a/lib/lp/charms/model/charmrecipebuild.py b/lib/lp/charms/model/charmrecipebuild.py
index 2374924..5b5a1e6 100644
--- a/lib/lp/charms/model/charmrecipebuild.py
+++ b/lib/lp/charms/model/charmrecipebuild.py
@@ -389,7 +389,7 @@ class CharmRecipeBuild(PackageBuildMixin, StormBase):
"""See `IPackageBuild`."""
return not self.getFiles().is_empty()
- def updateStatus(self, status, builder=None, slave_status=None,
+ def updateStatus(self, status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
"""See `IBuildFarmJob`."""
@@ -398,13 +398,13 @@ class CharmRecipeBuild(PackageBuildMixin, StormBase):
self, edited_fields,
snapshot_names=("status", "revision_id")) as previous_obj:
super().updateStatus(
- status, builder=builder, slave_status=slave_status,
+ status, builder=builder, worker_status=worker_status,
date_started=date_started, date_finished=date_finished,
force_invalid_transition=force_invalid_transition)
if self.status != previous_obj.status:
edited_fields.add("status")
- if slave_status is not None:
- revision_id = slave_status.get("revision_id")
+ if worker_status is not None:
+ revision_id = worker_status.get("revision_id")
if revision_id is not None:
self.revision_id = six.ensure_text(revision_id)
if revision_id != previous_obj.revision_id:
diff --git a/lib/lp/charms/tests/test_charmrecipebuild.py b/lib/lp/charms/tests/test_charmrecipebuild.py
index 349f934..0b890d2 100644
--- a/lib/lp/charms/tests/test_charmrecipebuild.py
+++ b/lib/lp/charms/tests/test_charmrecipebuild.py
@@ -276,10 +276,10 @@ class TestCharmRecipeBuild(TestCaseWithFactory):
def test_updateStatus_stores_revision_id(self):
# If the builder reports a revision_id, updateStatus saves it.
self.assertIsNone(self.build.revision_id)
- self.build.updateStatus(BuildStatus.BUILDING, slave_status={})
+ self.build.updateStatus(BuildStatus.BUILDING, worker_status={})
self.assertIsNone(self.build.revision_id)
self.build.updateStatus(
- BuildStatus.BUILDING, slave_status={"revision_id": "dummy"})
+ BuildStatus.BUILDING, worker_status={"revision_id": "dummy"})
self.assertEqual("dummy", self.build.revision_id)
def test_updateStatus_triggers_webhooks(self):
@@ -341,7 +341,7 @@ class TestCharmRecipeBuild(TestCaseWithFactory):
self.assertThat(logger.output, LogsScheduledWebhooks(expected_logs))
self.build.updateStatus(
BuildStatus.BUILDING, builder=builder,
- slave_status={"revision_id": "1"})
+ worker_status={"revision_id": "1"})
self.assertEqual(1, hook.deliveries.count())
self.assertThat(logger.output, LogsScheduledWebhooks(expected_logs))
self.build.updateStatus(BuildStatus.UPLOADING)
diff --git a/lib/lp/oci/model/ocirecipebuild.py b/lib/lp/oci/model/ocirecipebuild.py
index 13cc08a..753bf64 100644
--- a/lib/lp/oci/model/ocirecipebuild.py
+++ b/lib/lp/oci/model/ocirecipebuild.py
@@ -345,14 +345,14 @@ class OCIRecipeBuild(PackageBuildMixin, StormBase):
return self.recipe.distro_series.getDistroArchSeriesByProcessor(
self.processor)
- def updateStatus(self, status, builder=None, slave_status=None,
+ def updateStatus(self, status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
"""See `IBuildFarmJob`."""
edited_fields = set()
with notify_modified(self, edited_fields) as previous_obj:
super().updateStatus(
- status, builder=builder, slave_status=slave_status,
+ status, builder=builder, worker_status=worker_status,
date_started=date_started, date_finished=date_finished,
force_invalid_transition=force_invalid_transition)
if self.status != previous_obj.status:
diff --git a/lib/lp/snappy/browser/tests/test_snapbuild.py b/lib/lp/snappy/browser/tests/test_snapbuild.py
index 5b802d5..2e1fb5f 100644
--- a/lib/lp/snappy/browser/tests/test_snapbuild.py
+++ b/lib/lp/snappy/browser/tests/test_snapbuild.py
@@ -81,7 +81,7 @@ class TestSnapBuildView(TestCaseWithFactory):
def test_revision_id(self):
build = self.factory.makeSnapBuild()
build.updateStatus(
- BuildStatus.FULLYBUILT, slave_status={"revision_id": "dummy"})
+ BuildStatus.FULLYBUILT, worker_status={"revision_id": "dummy"})
build_view = create_initialized_view(build, "+index")
self.assertThat(build_view(), soupmatchers.HTMLContains(
soupmatchers.Tag(
diff --git a/lib/lp/snappy/model/snapbuild.py b/lib/lp/snappy/model/snapbuild.py
index 24fa63f..0279834 100644
--- a/lib/lp/snappy/model/snapbuild.py
+++ b/lib/lp/snappy/model/snapbuild.py
@@ -353,17 +353,17 @@ class SnapBuild(PackageBuildMixin, Storm):
"""See `IPackageBuild`."""
return not self.getFiles().is_empty()
- def updateStatus(self, status, builder=None, slave_status=None,
+ def updateStatus(self, status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
"""See `IBuildFarmJob`."""
old_status = self.status
super().updateStatus(
- status, builder=builder, slave_status=slave_status,
+ status, builder=builder, worker_status=worker_status,
date_started=date_started, date_finished=date_finished,
force_invalid_transition=force_invalid_transition)
- if slave_status is not None:
- revision_id = slave_status.get("revision_id")
+ if worker_status is not None:
+ revision_id = worker_status.get("revision_id")
if revision_id is not None:
self.revision_id = six.ensure_text(revision_id)
if status != old_status:
diff --git a/lib/lp/snappy/tests/test_snapbuild.py b/lib/lp/snappy/tests/test_snapbuild.py
index 639893f..0cf70ac 100644
--- a/lib/lp/snappy/tests/test_snapbuild.py
+++ b/lib/lp/snappy/tests/test_snapbuild.py
@@ -317,10 +317,10 @@ class TestSnapBuild(TestCaseWithFactory):
def test_updateStatus_stores_revision_id(self):
# If the builder reports a revision_id, updateStatus saves it.
self.assertIsNone(self.build.revision_id)
- self.build.updateStatus(BuildStatus.BUILDING, slave_status={})
+ self.build.updateStatus(BuildStatus.BUILDING, worker_status={})
self.assertIsNone(self.build.revision_id)
self.build.updateStatus(
- BuildStatus.BUILDING, slave_status={"revision_id": "dummy"})
+ BuildStatus.BUILDING, worker_status={"revision_id": "dummy"})
self.assertEqual("dummy", self.build.revision_id)
def test_updateStatus_triggers_webhooks(self):
@@ -372,7 +372,7 @@ class TestSnapBuild(TestCaseWithFactory):
self.assertThat(logger.output, LogsScheduledWebhooks(expected_logs))
self.build.updateStatus(
BuildStatus.BUILDING, builder=builder,
- slave_status={"revision_id": "1"})
+ worker_status={"revision_id": "1"})
self.assertEqual(1, hook.deliveries.count())
self.assertThat(logger.output, LogsScheduledWebhooks(expected_logs))
self.build.updateStatus(BuildStatus.UPLOADING)
diff --git a/lib/lp/soyuz/model/livefsbuild.py b/lib/lp/soyuz/model/livefsbuild.py
index 79865ec..1ff91f5 100644
--- a/lib/lp/soyuz/model/livefsbuild.py
+++ b/lib/lp/soyuz/model/livefsbuild.py
@@ -296,7 +296,7 @@ class LiveFSBuild(PackageBuildMixin, Storm):
"""See `IPackageBuild`."""
return not self.getFiles().is_empty()
- def updateStatus(self, status, builder=None, slave_status=None,
+ def updateStatus(self, status, builder=None, worker_status=None,
date_started=None, date_finished=None,
force_invalid_transition=False):
"""See `IBuildFarmJob`."""
@@ -304,7 +304,7 @@ class LiveFSBuild(PackageBuildMixin, Storm):
edited_fields = set()
with notify_modified(self, edited_fields) as previous_obj:
super().updateStatus(
- status, builder=builder, slave_status=slave_status,
+ status, builder=builder, worker_status=worker_status,
date_started=date_started, date_finished=date_finished,
force_invalid_transition=force_invalid_transition)
if self.status != previous_obj.status:
diff --git a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
index 24b2462..68d4bd4 100644
--- a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
+++ b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
@@ -48,7 +48,7 @@ class TestRetryDepwait(TestCaseWithFactory):
# Builds with unsatisfied dependencies are not retried.
self.build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'something'})
+ worker_status={'dependencies': 'something'})
self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT)
self.assertEqual(1, self.build.updateDependencies.call_count)
@@ -101,7 +101,7 @@ class TestRetryDepwait(TestCaseWithFactory):
self.assertEqual(BuildStatus.MANUALDEPWAIT, self.build.status)
bpn = self.factory.getUniqueUnicode()
self.build.updateStatus(
- BuildStatus.MANUALDEPWAIT, slave_status={'dependencies': bpn})
+ BuildStatus.MANUALDEPWAIT, worker_status={'dependencies': bpn})
# With no binary to satisfy the dependency, running the script
# does nothing.
diff --git a/lib/lp/soyuz/tests/test_binarypackagebuild.py b/lib/lp/soyuz/tests/test_binarypackagebuild.py
index 9bfbb41..1d43230 100644
--- a/lib/lp/soyuz/tests/test_binarypackagebuild.py
+++ b/lib/lp/soyuz/tests/test_binarypackagebuild.py
@@ -247,7 +247,7 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
[depwait_build] = depwait_source.createMissingBuilds()
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin'})
+ worker_status={'dependencies': 'dep-bin'})
return depwait_build
def testUpdateDependenciesWorks(self):
@@ -261,7 +261,7 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
def assertRaisesUnparsableDependencies(self, depwait_build, dependencies):
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': dependencies})
+ worker_status={'dependencies': dependencies})
self.assertRaises(
UnparsableDependencies, depwait_build.updateDependencies)
@@ -311,12 +311,12 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin (>> 666)'})
+ worker_status={'dependencies': 'dep-bin (>> 666)'})
depwait_build.updateDependencies()
self.assertEqual(depwait_build.dependencies, 'dep-bin (>> 666)')
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin (>= 666)'})
+ worker_status={'dependencies': 'dep-bin (>= 666)'})
depwait_build.updateDependencies()
self.assertEqual(depwait_build.dependencies, '')
@@ -334,12 +334,12 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin (= 666)'})
+ worker_status={'dependencies': 'dep-bin (= 666)'})
depwait_build.updateDependencies()
self.assertEqual(depwait_build.dependencies, '')
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin (= 999)'})
+ worker_status={'dependencies': 'dep-bin (= 999)'})
depwait_build.updateDependencies()
self.assertEqual(depwait_build.dependencies, '')
@@ -354,7 +354,7 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
('dep-bin (>> 888)', 'dep-bin (>> 888)'),
):
depwait_build.updateStatus(
- BuildStatus.MANUALDEPWAIT, slave_status={'dependencies': dep})
+ BuildStatus.MANUALDEPWAIT, worker_status={'dependencies': dep})
depwait_build.updateDependencies()
self.assertEqual(expected, depwait_build.dependencies)
@@ -366,7 +366,7 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={
+ worker_status={
'dependencies': 'dep-bin (>= 999) | alt-bin, dep-tools'})
depwait_build.updateDependencies()
self.assertEqual(
@@ -388,12 +388,12 @@ class TestBuildUpdateDependencies(TestCaseWithFactory):
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin (> 666), dep-bin (< 777)'})
+ worker_status={'dependencies': 'dep-bin (> 666), dep-bin (< 777)'})
depwait_build.updateDependencies()
self.assertEqual(depwait_build.dependencies, 'dep-bin (> 666)')
depwait_build.updateStatus(
BuildStatus.MANUALDEPWAIT,
- slave_status={'dependencies': 'dep-bin (> 665)'})
+ worker_status={'dependencies': 'dep-bin (> 665)'})
depwait_build.updateDependencies()
self.assertEqual(depwait_build.dependencies, '')
diff --git a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py
index 1c0d34d..8935403 100644
--- a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py
+++ b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py
@@ -554,9 +554,9 @@ class TestBinaryBuildPackageBehaviourBuildCollection(TestCaseWithFactory):
@defer.inlineCallbacks
def updateBuild(self, candidate, slave):
bf = MockBuilderFactory(self.builder, candidate)
- slave_status = yield slave.status()
+ worker_status = yield slave.status()
yield self.interactor.updateBuild(
- bf.getVitals('foo'), slave, slave_status, bf,
+ bf.getVitals('foo'), slave, worker_status, bf,
self.interactor.getBuildBehaviour, self.manager)
self.manager.flushLogTails()
diff --git a/lib/lp/soyuz/tests/test_build_depwait.py b/lib/lp/soyuz/tests/test_build_depwait.py
index f4d9567..eff95ce 100644
--- a/lib/lp/soyuz/tests/test_build_depwait.py
+++ b/lib/lp/soyuz/tests/test_build_depwait.py
@@ -56,7 +56,7 @@ class TestBuildDepWait(TestCaseWithFactory):
version = "%s.1" % self.factory.getUniqueInteger()
with person_logged_in(self.admin):
build.updateStatus(
- BuildStatus.MANUALDEPWAIT, slave_status={'dependencies': spn})
+ BuildStatus.MANUALDEPWAIT, worker_status={'dependencies': spn})
[bpph] = self.publisher.getPubBinaries(
binaryname=spn, distroseries=self.distroseries,
version=version, builder=self.builder, archive=self.archive,
@@ -78,7 +78,7 @@ class TestBuildDepWait(TestCaseWithFactory):
version = "%s.1" % self.factory.getUniqueInteger()
with person_logged_in(self.admin):
build.updateStatus(
- BuildStatus.MANUALDEPWAIT,slave_status={'dependencies': spn})
+ BuildStatus.MANUALDEPWAIT, worker_status={'dependencies': spn})
[bpph] = self.publisher.getPubBinaries(
binaryname=spn, distroseries=self.distroseries,
version=version, builder=self.builder, archive=self.archive,
diff --git a/lib/lp/translations/model/translationtemplatesbuildbehaviour.py b/lib/lp/translations/model/translationtemplatesbuildbehaviour.py
index f141c87..e04890b 100644
--- a/lib/lp/translations/model/translationtemplatesbuildbehaviour.py
+++ b/lib/lp/translations/model/translationtemplatesbuildbehaviour.py
@@ -101,11 +101,11 @@ class TranslationTemplatesBuildBehaviour(BuildFarmJobBehaviourBase):
approver_factory=TranslationBuildApprover)
@defer.inlineCallbacks
- def handleSuccess(self, slave_status, logger):
+ def handleSuccess(self, worker_status, logger):
"""Deal with a finished build job.
- Retrieves tarball and logs from the slave, then cleans up the
- slave so it's ready for a next job and destroys the queue item.
+ Retrieves tarball and logs from the worker, then cleans up the
+ worker so it's ready for a next job and destroys the queue item.
If this fails for whatever unforeseen reason, a future run will
retry it.
@@ -115,7 +115,7 @@ class TranslationTemplatesBuildBehaviour(BuildFarmJobBehaviourBase):
builder=self.build.buildqueue_record.builder)
transaction.commit()
logger.debug("Processing successful templates build.")
- filemap = slave_status.get('filemap')
+ filemap = worker_status.get('filemap')
filename = yield self._readTarball(
self.build.buildqueue_record, filemap, logger)