From dce4073f518ab52b042e1e6630d4727ec9a8cb6d Mon Sep 17 00:00:00 2001 From: Chris Maes Date: Fri, 25 Oct 2019 17:15:08 +0200 Subject: [PATCH] jobs.py: don't yield jobs twice (#740) --- jenkinsapi/jobs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jenkinsapi/jobs.py b/jenkinsapi/jobs.py index 61305b97..abc0b57e 100644 --- a/jenkinsapi/jobs.py +++ b/jenkinsapi/jobs.py @@ -93,9 +93,10 @@ def iteritems(self): Iterate over the names & objects for all jobs """ for job in self.itervalues(): - yield job.name, job if job.name != job.get_full_name(): yield job.get_full_name(), job + else: + yield job.name, job def __contains__(self, job_name): """ @@ -110,12 +111,13 @@ def iterkeys(self): if not self._data: self._data = self.poll().get('jobs', []) for row in self._data: - yield row['name'] if row['name'] != \ Job.get_full_name_from_url_and_baseurl(row['url'], self.jenkins.baseurl): yield Job.get_full_name_from_url_and_baseurl( row['url'], self.jenkins.baseurl) + else: + yield row['name'] def itervalues(self): """