def add_package_instances(origin, job_name, build_number, changes_file, version, start, end):
con = db_connect()
- #logger.debug("save %s to database" %(job_name))
+ logger.debug("save %s to database" %(job_name))
db_origin_id = db_add_origin(con, origin)
- #logger.debug("INSERT success origin %s" % origin)
+ logger.debug("INSERT success origin %s" % origin)
db_job_id = db_add_job(con, job_name)
- #logger.debug("INSERT success job %s" % job_name)
+ logger.debug("INSERT success job %s" % job_name)
# maybe FIXME: we could add the build already once its started, but for package builds we dont wanna add failures to the db at all
db_build_id = db_add_build (con, build_number, db_job_id)
db_build_result_id = db_add_build_result (con, db_build_id, start, end)
- #logger.debug("INSERT success build number %s" % build_number)
- #logger.debug("processing %s" %(changes_file))
+ logger.debug("INSERT success build number %s" % build_number)
+ logger.debug("processing %s" %(changes_file))
cmd = ["dcmd", '--deb', changes_file]
cmdobj = subprocess.Popen(
cmd,
db_package_instance_ids=[]
for line in cmdobj.stdout.readlines():
package = os.path.basename(line.strip()).split('_')[0]
- #logger.debug('package: %s' %(package))
+ logger.debug('package: %s' %(package))
db_package_id = db_add_package (con, package)
- #logger.debug("INSERT success package %s" % package)
+ logger.debug("INSERT success package %s" % package)
db_package_instance_ids.append(db_add_package_instance (con, db_package_id, db_origin_id, db_build_result_id, version))
logger.debug("INSERT success package version %s %s" %( package,version))
#logger.debug('Cmd returned with status %d' %(cmdobj.returncode))
def add_package_version(origin, package, version):
logger = logger_init()
con = db_connect()
- #logger.debug("save %s to database" %(job_name))
db_origin_id = db_add_origin(con, origin)
db_package_id = db_add_package (con, package)
db_package_instance_id = db_add_package_instance (con, db_package_id, db_origin_id, 'NULL', version)
try:
package_instances = add_package_instance("profitbricks", BUILD_JOBNAME, BUILD_NUMBER, changes_file, version, BUILD_START, BUILD_END)
except Exception, error:
- cmd = ['figlet-figlet', '-t', 'package instance not added to DB']
+ cmd = ['figlet-figlet', '-t', 'CIDB problem:']
subprocess.check_call(cmd)
- #FIXME: this should really cause an error
- # exit_error()
+ logger_error("package instance not added to DB")
+ exit_error()
if len(package_instances) > 0:
try:
add_liveboot_request(package_instances)