" JOIN deb_package AS dp ON (dpi.deb_package_id = dp.id)"
" WHERE dp.id=%s", (deb_package_id,))
result = cur.fetchall()
- return tuple([ i[0] for i in result ])
+ return tuple([i[0] for i in result])
def duplicate_pkg_list(con, deb_package_list_id):
result = cur.fetchone()
return result[0]
+
def trigger_jenkins_build(request_id):
- urllib2.urlopen("http://jenkins/view/_Tests/job/liveboot/"
- "buildWithParameters?token=BuildIt&REQUEST_ID=" + str(REQUEST_ID)).read()
- logger.info("Jenkins build triggered")
+ url = "http://jenkins/view/_Tests/job/liveboot/buildWithParameters?token"
+ "=BuildIt&REQUEST_ID=" + str(request_id)
+ urllib2.urlopen(url).read()
+ logger.info("Jenkins build triggered (%s)" % url)
+
def add_liveboot_request(deb_pkg_instance_ids):
""" Creates a new liveboot request.
logger.debug("deb_pkg_instance_id %s included in the liveboot"
" request" % deb_pkg_instance_id)
else:
- logger.debug("deb_pkg_instance_id %s isn't included in the liveboot"
- " request because it isn't member of the default package list"
- % deb_pkg_instance_id)
+ logger.debug("deb_pkg_instance_id %s isn't included in the"
+ " liveboot request. It isn't listed in the default"
+ " package list" % deb_pkg_instance_id)
if def_pkg_list_updated:
pkg_list = duplicate_pkg_list(con, def_pkg_list_id)
try:
jenkins_uid = pwd.getpwnam("jenkins").pw_uid
except Exception as e:
- logger.warning("User jenkins can't be found, liveboot_request uid is"
- " unspecified")
+ logger.warning("User jenkins can't be found, liveboot_request uid"
+ " is unspecified")
jenkins_uid = None
request_id = insert_liveboot_request(con, jenkins_uid, def_pkg_list_id)
if __name__ == "__main__":
add_liveboot_request(sys.argv[1:])
-