else:
build = job.get_last_good_build()
artifacts = build.get_artifact_dict()
- log.info("Found %i artifacts in '%s'" % (len(artifacts.keys()), build_no))
+ log.info(msg="Found %i artifacts in '%s'" % (len(artifacts.keys()), build_no))
return artifacts
if set(artifact_ids).issubset(set(artifacts.keys())):
return dict((a, artifacts[a]) for a in artifact_ids)
missing_artifacts = set(artifact_ids) - set(artifacts.keys())
- log.debug("Artifacts %s missing from %s #%i" % (", ".join(missing_artifacts), jobid, build_id))
+ log.debug(msg="Artifacts %s missing from %s #%i" % (", ".join(missing_artifacts), jobid, build_id))
#noinspection PyUnboundLocalVariable
raise ArtifactsMissing(missing_artifacts)
if not still_running:
return
str_still_running = ", ".join('"%s"' % str(a) for a in still_running)
- log.warn("Waiting for jobs %s to complete. Will wait another %is" % (str_still_running, time_left))
+ log.warn(msg="Waiting for jobs %s to complete. Will wait another %is" % (str_still_running, time_left))
time.sleep(interval)
if raise_on_timeout:
#noinspection PyUnboundLocalVariable
for reldir, artifactnames in dirstruct.items():
destdir = os.path.join(installdir, reldir)
if not os.path.exists(destdir):
- log.warn("Making install directory %s" % destdir)
+ log.warn(msg="Making install directory %s" % destdir)
os.makedirs(destdir)
else:
assert os.path.isdir(destdir)
:param fspath: full pathname including the filename, str
:return: filepath
"""
- log.info("Saving artifact @ %s to %s" % (self.url, fspath))
+ log.info(msg="Saving artifact @ %s to %s" % (self.url, fspath))
if not fspath.endswith(self.filename):
- log.warn("Attempt to change the filename of artifact %s on save." % self.filename)
+ log.warn(msg="Attempt to change the filename of artifact %s on save." % self.filename)
if os.path.exists(fspath):
if self.build:
try:
if self._verify_download(fspath):
- log.info("Local copy of %s is already up to date." % self.filename)
+ log.info(msg="Local copy of %s is already up to date." % self.filename)
return fspath
except ArtifactBroken:
log.info("Jenkins artifact could not be identified.")
count = 0
while self.is_running():
total_wait = delay * count
- log.info("Waited %is for %s #%s to complete" % (total_wait, self.job.name, self.name))
+ log.info(msg="Waited %is for %s #%s to complete" % (total_wait, self.job.name, self.name))
sleep(delay)
count += 1
if self._data["original"]["number"] == build:
return True
if self._data["fileName"] != filename:
- log.info("Filename from jenkins (%s) did not match provided (%s)" % (self._data["fileName"], filename))
+ log.info(msg="Filename from jenkins (%s) did not match provided (%s)" % (self._data["fileName"], filename))
return False
for usage_item in self._data["usage"]:
if usage_item["name"] == job:
for range in usage_item["ranges"]["ranges"]:
if range["start"] <= build <= range["end"]:
- log.info("This artifact was generated by %s between build %i and %i" % (job, range["start"], range["end"]))
+ log.info(msg="This artifact was generated by %s between build %i and %i" % (job, range["start"], range["end"]))
return True
return False
def validate_fingerprint(self, id):
obj_fingerprint = Fingerprint(self.baseurl, id, jenkins_obj=self)
obj_fingerprint.validate()
- log.info("Jenkins says %s is valid" % id)
+ log.info(msg="Jenkins says %s is valid" % id)
# def reload(self):
# '''Try and reload the configuration from disk'''
"""
if not job:
if str_job_name in self.get_job_dict():
- log.warn('Job %s is already in the view %s' %
+ log.warn(msg='Job %s is already in the view %s' %
(str_job_name, self.name))
return False
else:
top_jenkins = self.get_jenkins_obj().get_jenkins_obj_from_url(
self.baseurl.split('view/')[0])
if not top_jenkins.has_job(str_job_name):
- log.error('Job "%s" is not known to Jenkins' % str_job_name)
+ log.error(msg='Job "%s" is not known to Jenkins' % str_job_name)
return False
else:
job = top_jenkins.get_job(str_job_name)
- log.info('Creating job %s in view %s' % (str_job_name, self.name))
+ log.info(msg='Creating job %s in view %s' % (str_job_name, self.name))
data = {
"description": "",
"statusFilter": "",
self.get_jenkins_obj().requester.post_and_confirm_status(
'%s/configSubmit' % self.baseurl, data=data)
self.poll()
- log.debug('Job "%s" has been added to a view "%s"' %
+ log.debug(msg='Job "%s" has been added to a view "%s"' %
(job.name, self.name))
return True
:param person: Person name (to create personal view), str
:return: new View obj or None if view was not created
"""
- log.info('Creating "%s" view "%s"' % (view_type, view_name))
+ 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('View "%s" already exists' % view_name)
+ log.warn(msg='View "%s" already exists' % view_name)
return self[view_name]
url = '%s/createView' % self.jenkins.baseurl
# Regular expression which should only match correct variable names
# Amplify: Up to 40 characters long
-variable-rgx=[a-z_][a-z0-9_]{2,40}$
+# variable-rgx=[a-z_][a-z0-9_]{2,40}$
+variable-rgx=[A-Za-z_][A-Za-z0-9_]{1,40}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names