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')
"""
(fd, path) = tempfile.mkstemp("", "transitions", Cnf["Dir::TempPath"])
"""
(fd, path) = tempfile.mkstemp("", "transitions", Cnf["Dir::TempPath"])
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")
print "Transition source %s not in testing, transition still ongoing." % (source)
else:
current = sourceobj.version
print "Transition source %s not in testing, transition still ongoing." % (source)
else:
current = sourceobj.version
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 "Apt compare says: %s" % (compare)
if compare < 0:
# This is still valid, the current version in database is older than
print "Apt compare says: %s" % (compare)
if compare < 0:
# This is still valid, the current version in database is older than
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." %
sys.exit(1)
# Also check if our temp directory is defined and existant
temppath = Cnf.get("Dir::TempPath", "")
sys.exit(1)
# Also check if our temp directory is defined and existant
temppath = Cnf.get("Dir::TempPath", "")