# Only check if there is a file defined (and existant) with checks. It's a little bit
# specific to Debian, not much use for others, so return early there.
- if not Cnf.has_key("Dinstall::Reject::ReleaseTransitions") and
- not os.path.exists("%s" % (Cnf["Dinstall::Reject::ReleaseTransitions"])):
+ if not Cnf.has_key("Dinstall::Reject::ReleaseTransitions") or not os.path.exists("%s" % (Cnf["Dinstall::Reject::ReleaseTransitions"])):
return
# Parse the yaml file
sourcefile = file(Cnf["Dinstall::Reject::ReleaseTransitions"], 'r')
+ sourcecontent = sourcefile.read()
try:
- transitions = load(sourcefile)
+ transitions = load(sourcecontent)
except error, msg:
# This shouldn't happen, the release team has a wrapper to check the file, but better
# safe then sorry
- utils.warn("Not checking transitions, the transitions file is broken: %s." % (msg))
+ daklib.utils.warn("Not checking transitions, the transitions file is broken: %s." % (msg))
return
# Now look through all defined transitions
- for trans in transition:
- t = transition[trans]
+ for trans in transitions:
+ t = transitions[trans]
source = t["source"]
new_vers = t["new"]