except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy DM table updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy DM table updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new comments update, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new comments update, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new update 12, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new update 12, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new update 13, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new update 13, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new update 14, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new update 14, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply source format update 15, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply source format update 15, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply ACLs update (16), rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply ACLs update (16), rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new update 17, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new update 17, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply knownchanges update 18, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply knownchanges update 18, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply debversion update 19, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply debversion update 19, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply debversion update 20, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply debversion update 20, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.InternalError as msg:
self.db.rollback()
- raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new update 28, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new update 28, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy versioncmp removal, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy versioncmp removal, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply process-new update 31, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply process-new update 31, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply build_queue update 32, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply build_queue update 32, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply build_queue update 33, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply build_queue update 33, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply build_queue update 34, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply build_queue update 34, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply build_queue update 35, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply build_queue update 35, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply build_queue update 36, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply build_queue update 36, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply table-colum update 37, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply table-colum update 37, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply table-column update 38, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply table-column update 38, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply table-column update 39, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply table-column update 39, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply sanity to suite_architecture table, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply sanity to suite_architecture table, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 40, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 40, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 41, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 41, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply update 42, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply update 42, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply update 43, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply update 43, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 44, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 44, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply update 45, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply update 45, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply update 46, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply update 46, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 47, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 47, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 48, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 48, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 49, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 49, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to recreate bin_assoc_by_arch view, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to recreate bin_assoc_by_arch view, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 50, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 50, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 51, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 51, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 52, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 52, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 53, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 53, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 54, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 54, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 55, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 55, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 56, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 56, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 57, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 57, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 58, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 58, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 59, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 59, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 60, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 60, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 61, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 61, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 62, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 62, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 63, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 63, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 64, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 64, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 65, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 65, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, 'Unable to apply sick update 66, rollback issued. Error message : %s' % (str(msg))
+ raise DBUpdateError('Unable to apply sick update 66, rollback issued. Error message : %s' % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to appy suite config updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to appy suite config updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)))
except psycopg2.ProgrammingError as msg:
self.db.rollback()
- raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))
+ raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)))
os.system("bzip2 -d < %s.bz2 > %s" % (f, t))
else:
print "missing: %s" % (f)
- raise IOError, f
+ raise IOError(f)
def smartopen(file):
if os.path.isfile(file):
except OSError as e:
if e.errno == errno.EEXIST or e.errno == errno.EACCES:
user = pwd.getpwuid(os.stat(path)[stat.ST_UID])[4].split(',')[0].replace('.', '')
- raise AlreadyLockedError, user
+ raise AlreadyLockedError(user)
try:
yield fd
else:
trans = load_transitions(from_file)
if trans is None:
- raise TransitionsError, "Unparsable transitions file %s" % (file)
+ raise TransitionsError("Unparsable transitions file %s" % (file))
write_transitions(trans)
################################################################################
# Find source id
bin_sources = get_sources_from_name(entry["source package"], entry["source version"], session=session)
if len(bin_sources) != 1:
- raise NoSourceFieldError, "Unable to find a unique source id for %s (%s), %s, file %s, type %s, signed by %s" % \
+ raise NoSourceFieldError("Unable to find a unique source id for %s (%s), %s, file %s, type %s, signed by %s" % \
(bin.package, bin.version, entry["architecture"],
- filename, bin.binarytype, u.pkg.changes["fingerprint"])
+ filename, bin.binarytype, u.pkg.changes["fingerprint"]))
bin.source_id = bin_sources[0].source_id
for srcname, version in entry["built-using"]:
exsources = get_sources_from_name(srcname, version, session=session)
if len(exsources) != 1:
- raise NoSourceFieldError, "Unable to find source package (%s = %s) in Built-Using for %s (%s), %s, file %s, type %s, signed by %s" % \
+ raise NoSourceFieldError("Unable to find source package (%s = %s) in Built-Using for %s (%s), %s, file %s, type %s, signed by %s" % \
(srcname, version, bin.package, bin.version, entry["architecture"],
- filename, bin.binarytype, u.pkg.changes["fingerprint"])
+ filename, bin.binarytype, u.pkg.changes["fingerprint"]))
bin.extra_sources.append(exsources[0])
format = re_verwithext.search(txt)
if format is None:
- raise UnknownFormatError, txt
+ raise UnknownFormatError(txt)
format = format.groups()
"""
if (format < (1, 5) or format > (1, 8)):
- raise UnknownFormatError, repr(format)
+ raise UnknownFormatError(repr(format))
if field != 'files' and format < (1, 8):
- raise UnknownFormatError, repr(format)
+ raise UnknownFormatError(repr(format))
if format.re_format.match(txt):
return format
- raise UnknownFormatError, "Unknown format %r" % txt
+ raise UnknownFormatError("Unknown format %r" % txt)
class SourceFormat(type):
def __new__(cls, name, bases, attrs):
else:
m = re_parse_maintainer.match(maintainer)
if not m:
- raise ParseMaintError, "Doesn't parse as a valid Maintainer field."
+ raise ParseMaintError("Doesn't parse as a valid Maintainer field.")
name = m.group(1)
email = m.group(2)
rfc2047_maint = "%s <%s>" % (rfc2047_name, email)
if email.find("@") == -1 and email.find("buildd_") != 0:
- raise ParseMaintError, "No @ found in email address part."
+ raise ParseMaintError("No @ found in email address part.")
return (rfc822_maint, rfc2047_maint, name, email)
try:
f = open(filename, mode)
except IOError:
- raise CantOpenError, filename
+ raise CantOpenError(filename)
return f
################################################################################
lines = contents.splitlines(True)
if len(lines) == 0:
- raise ParseChangesError, "[Empty changes file]"
+ raise ParseChangesError("[Empty changes file]")
# Reindex by line number so we can easily verify the format of
# .dsc files...
line = indexed_lines[index]
if line == "" and signing_rules == 1:
if index != num_of_lines:
- raise InvalidDscError, index
+ raise InvalidDscError(index)
break
slf = re_single_line_field.match(line)
if slf:
mlf = re_multi_line_field.match(line)
if mlf:
if first == -1:
- raise ParseChangesError, "'%s'\n [Multi-line field continuing on from nothing?]" % (line)
+ raise ParseChangesError("'%s'\n [Multi-line field continuing on from nothing?]" % (line))
if first == 1 and changes[field] != "":
changes[field] += '\n'
first = 0
changes["source-version"] = srcver.group(2)
if error:
- raise ParseChangesError, error
+ raise ParseChangesError(error)
return changes
try:
unicode(content, 'utf-8')
except UnicodeError:
- raise ChangesUnicodeError, "Changes file not proper utf-8"
+ raise ChangesUnicodeError("Changes file not proper utf-8")
changes = parse_deb822(content, signing_rules, keyrings=keyrings)
missingfields.append(keyword)
if len(missingfields):
- raise ParseChangesError, "Missing mandantory field(s) in changes file (policy 5.5): %s" % (missingfields)
+ raise ParseChangesError("Missing mandantory field(s) in changes file (policy 5.5): %s" % (missingfields))
return changes
else:
(md5, size, name) = s
except ValueError:
- raise ParseChangesError, i
+ raise ParseChangesError(i)
if section == "":
section = "-"
# Invoke sendmail
(result, output) = commands.getstatusoutput("%s < %s" % (Cnf["Dinstall::SendmailCommand"], filename))
if (result != 0):
- raise SendmailFailedError, output
+ raise SendmailFailedError(output)
# Clean up any temporary files
if message: