Remove job_name attribute form NodesProvisionedEvent

When moving the NodesProvisionedEvents to ZooKeeper, this was needed to
lookup empty NodeRequests in the scheduler as those requests weren't
stored in ZooKeeper and didn't provide any ID.

Some of the newer changes which are related to how node requests are
handled in Zuul made this attribute obsolete.

Change-Id: I382473bd10150bd47237cecc05ebcd345cf98ba8
This commit is contained in:
Felix Edel 2021-09-21 15:47:53 +02:00
parent 66008900a8
commit 5997228e46
2 changed files with 2 additions and 10 deletions

View File

@ -4272,19 +4272,13 @@ class NodesProvisionedEvent(ResultEvent):
:arg str build_set_uuid: UUID of the buildset this node request belongs to
"""
def __init__(self, request_id, job_name, build_set_uuid):
def __init__(self, request_id, build_set_uuid):
self.request_id = request_id
# We have to use the job_name to look up empty node requests from the
# buildset (as empty node requests don't have an id).
# TODO (felix): Is the job_name still needed? We are now also storing
# empty node requests in ZK, so they have an ID.
self.job_name = job_name
self.build_set_uuid = build_set_uuid
def toDict(self):
return {
"request_id": self.request_id,
"job_name": self.job_name,
"build_set_uuid": self.build_set_uuid,
}
@ -4292,7 +4286,6 @@ class NodesProvisionedEvent(ResultEvent):
def fromDict(cls, data):
return cls(
data.get("request_id"),
data.get("job_name"),
data.get("build_set_uuid"),
)

View File

@ -85,8 +85,7 @@ class Nodepool(object):
def _sendNodesProvisionedEvent(self, request):
tenant_name = request.tenant_name
pipeline_name = request.pipeline_name
event = model.NodesProvisionedEvent(
request.id, request.job_name, request.build_set_uuid)
event = model.NodesProvisionedEvent(request.id, request.build_set_uuid)
self.pipeline_result_events[tenant_name][pipeline_name].put(event)
def _electionWon(self):