cur = con.cursor()
cur.execute("SAVEPOINT a")
try:
- cur.execute("INSERT INTO jenkins_job(name) VALUES(%s)"
- " RETURNING id", (name))
+ cur.execute("INSERT INTO jenkins_job(name) VALUES(%s)")
logger.debug("saved %s to databased" %(job_name))
except psycopg2.DatabaseError as e:
# record already exist
# upload (if NO_UPLOAD is not set)
if NO_UPLOAD not in ('true', 'True'):
dput_package_upload(changes_file)
- add_package_instance("profitbricks", BUILD_JOBNAME, BUILD_NUMBER, changes_file, version)
else:
logger.debug('value of NO_UPLOAD: %s' % NO_UPLOAD)
logger.info('dist: %s' %(pb_suite))
logger.info('version: %s' %(version))
cmd = ['figlet-figlet', '-t', 'version: %s' %(version)]
subprocess.check_call(cmd)
- logger.info('---------------------------------------------------------------------------------------------------------')
- cmd = ['figlet-figlet', '-t', 'Success!!!']
- subprocess.check_call(cmd)
except Exception, error:
cmd = ['figlet-figlet', '-t', 'upload to reprepro failed:']
subprocess.check_call(cmd)
logger.exception(error)
exit_error()
+ logger.info('---------------------------------------------------------------------------------------------------------')
+ cmd = ['figlet-figlet', '-t', 'Success!!!']
+ subprocess.check_call(cmd)
+ try:
+ add_package_instance("profitbricks", BUILD_JOBNAME, BUILD_NUMBER, changes_file, version)
+ except Exception, error:
+ cmd = ['figlet-figlet', '-t', 'package instance not added to DB']
+ subprocess.check_call(cmd)
+ exit_error()
# finally
exit_ok()