]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_unchecked.py
Fix a number of syntax errors. Also do not remove elements from a dict where we itera...
[dak.git] / dak / process_unchecked.py
index d0fc9c029bf83a8e6b318f9a3cd4088857260d40..dc92f74fc5a2065d4d7259b788002f8966c16860 100755 (executable)
@@ -1008,23 +1008,23 @@ def check_transition(sourcepkg):
 
     # 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"]