From efa6e0a2bae6c478873e1ef53e20967f2eeb4aca Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 14 Sep 2017 17:00:22 -0600 Subject: [PATCH] Fix hostvars logstash job submission error The log server may have just been added to the inventory; we're really interested in the node the job ran on, so make sure that the node we grab is a nodepool node. Change-Id: I3f228f9a0c913476f946f546cdd5a2d56864c549 --- .../library/submit_log_processor_jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/submit-log-processor-jobs/library/submit_log_processor_jobs.py b/roles/submit-log-processor-jobs/library/submit_log_processor_jobs.py index e874abdfaa..1fa454dfeb 100644 --- a/roles/submit-log-processor-jobs/library/submit_log_processor_jobs.py +++ b/roles/submit-log-processor-jobs/library/submit_log_processor_jobs.py @@ -99,14 +99,14 @@ class LogMatcher(object): return out_event def makeFields(self, filename): - hosts = self.hosts + hosts = [h for h in self.hosts.values() if 'nodepool' in h] zuul = self.zuul fields = {} fields["filename"] = filename fields["build_name"] = zuul['job'] fields["build_status"] = self.success and 'SUCCESS' or 'FAILURE' # TODO: this is too simplistic for zuul v3 multinode jobs - node = list(hosts.values())[0] + node = hosts[0] fields["build_node"] = node['nodepool']['label'] # TODO: should be build_executor, or removed completely fields["build_master"] = zuul['executor']['hostname']