if not Cnf.has_key("Edit-Transitions::Options::%s" % (i)):
Cnf["Edit-Transitions::Options::%s" % (i)] = ""
if not Cnf.has_key("Edit-Transitions::Options::%s" % (i)):
Cnf["Edit-Transitions::Options::%s" % (i)] = ""
- trans = yaml.load(sourcecontent)
- except yaml.YAMLError, exc:
+ trans = yaml.safe_load(sourcecontent)
+ except yaml.YAMLError as exc:
if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EEXIST':
print "Unable to get lock for %s (try %d of 10)" % \
(file, retry+1)
if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EEXIST':
print "Unable to get lock for %s (try %d of 10)" % \
(file, retry+1)
trans_temp = trans_file + ".tmp"
trans_lock = lock_file(trans_file)
temp_lock = lock_file(trans_temp)
destfile = file(trans_temp, 'w')
trans_temp = trans_file + ".tmp"
trans_lock = lock_file(trans_file)
temp_lock = lock_file(trans_temp)
destfile = file(trans_temp, 'w')
- if not os.path.abspath(from_file).startswith(Cnf["Transitions::TempPath"]):
- print "Will not accept transitions file outside of %s" % (Cnf["Transitions::TempPath"])
+ if not os.path.abspath(from_file).startswith(Cnf["Dir::TempPath"]):
+ print "Will not accept transitions file outside of %s" % (Cnf["Dir::TempPath"])
- (fd, path) = tempfile.mkstemp("", "transitions", Cnf["Transitions::TempPath"])
- os.chmod(path, 0644)
+ (fd, path) = tempfile.mkstemp("", "transitions", Cnf["Dir::TempPath"])
+ os.chmod(path, 0o644)
return path
################################################################################
def edit_transitions():
""" Edit the defined transitions. """
return path
################################################################################
def edit_transitions():
""" Edit the defined transitions. """
edit_file = temp_transitions_file(load_transitions(trans_file))
editor = os.environ.get("EDITOR", "vi")
edit_file = temp_transitions_file(load_transitions(trans_file))
editor = os.environ.get("EDITOR", "vi")
info[trans] = get_info(trans, source, expected, t["rm"], t["reason"], t["packages"])
print info[trans]
info[trans] = get_info(trans, source, expected, t["rm"], t["reason"], t["packages"])
print info[trans]
- current = sources[0].version
- compare = apt_pkg.VersionCompare(current, expected)
+ current = sourceobj.version
+ compare = apt_pkg.version_compare(current, expected)
if compare < 0:
# This is still valid, the current version in database is older than
# the new version we wait for
if compare < 0:
# This is still valid, the current version in database is older than
# the new version we wait for
print get_info(trans, source, expected, t["rm"], t["reason"], t["packages"])
print get_info(trans, source, expected, t["rm"], t["reason"], t["packages"])
print "Apt compare says: %s" % (compare)
if compare < 0:
# This is still valid, the current version in database is older than
# the new version we wait for
print "Apt compare says: %s" % (compare)
if compare < 0:
# This is still valid, the current version in database is older than
# the new version we wait for
- print "%s wanted version: %s, has %s" % (source, expected, source.version)
+ print "%s wanted version: %s, has %s" % (source, expected, sourceobj.version)
print "-------------------------------------------------------------------------"
################################################################################
print "-------------------------------------------------------------------------"
################################################################################
sys.exit(1)
if not os.path.exists(transpath):
utils.warn("ReleaseTransitions file, %s, not found." %
sys.exit(1)
if not os.path.exists(transpath):
utils.warn("ReleaseTransitions file, %s, not found." %