missing_artifacts = set(artifact_ids) - set(artifacts.keys())
log.debug(msg="Artifacts %s missing from %s #%i"
% (", ".join(missing_artifacts), jobid, build_id))
- #noinspection PyUnboundLocalVariable
+ # noinspection PyUnboundLocalVariable
raise ArtifactsMissing(missing_artifacts)
% (str_still_running, time_left))
time.sleep(interval)
if raise_on_timeout:
- #noinspection PyUnboundLocalVariable
+ # noinspection PyUnboundLocalVariable
raise TimeOut("Waited too long for these jobs to complete: %s"
% str_still_running)
JenkinsBase.__init__(self, url)
def _poll(self):
- #For build's we need more information for downstream and upstream builds
- #so we override the poll to get at the extra data for build objects
+ # For build's we need more information for downstream and upstream builds
+ # so we override the poll to get at the extra data for build objects
url = self.python_api_url(self.baseurl) + '?depth=1'
return self.get_data(url)
return Views(self)
def get_view_by_url(self, str_view_url):
- #for nested view
+ # for nested view
str_view_name = str_view_url.split('/view/')[-1].replace('/', '')
return View(str_view_url, str_view_name, jenkins_obj=self)
raise AssertionError("Node is offline and not marked as temporarilyOffline" +
", check client connection: " +
"offline = %s , temporarilyOffline = %s" %
- (self._data['offline'], self._data['temporarilyOffline']))
+ (self._data['offline'], self._data['temporarilyOffline']))
elif self._data['offline'] and self._data['temporarilyOffline']:
self.toggle_temporarily_offline()
if self._data['offline']:
return [a[1] for a in self.iteritems()]
def _get_plugins(self):
- if not 'plugins' in self._data:
- pass
- else:
+ if 'plugins' in self._data:
for p_dict in self._data["plugins"]:
yield p_dict["shortName"], Plugin(p_dict)
return [a for a in self.iteritems()]
def _get_jobs(self):
- if not 'jobs' in self._data:
- pass
- else:
+ if 'jobs' in self._data:
for viewdict in self._data["jobs"]:
yield viewdict["name"], viewdict["url"]
job_dict = self.get_job_dict()
return job_dict[str_job_name]
except KeyError:
- #noinspection PyUnboundLocalVariable
+ # noinspection PyUnboundLocalVariable
all_views = ", ".join(job_dict.keys())
raise KeyError("Job %s is not known - available: %s" % (str_job_name, all_views))
:return: new View obj or None if view was not created
"""
log.info(msg='Creating "%s" view "%s"' % (view_type, view_name))
- #url = urlparse.urljoin(self.baseurl, "user/%s/my-views/" % person) if person else self.baseurl
if view_name in self:
log.warn(msg='View "%s" already exists' % view_name)