-#def is_unembargo(u):
-# session = DBConn().session()
-# cnf = Config()
-#
-# q = session.execute("SELECT package FROM disembargo WHERE package = :source AND version = :version", u.pkg.changes)
-# if q.rowcount > 0:
-# session.close()
-# return True
-#
-# oldcwd = os.getcwd()
-# os.chdir(cnf["Dir::Queue::Disembargo"])
-# disdir = os.getcwd()
-# os.chdir(oldcwd)
-#
-# ret = False
-#
-# if u.pkg.directory == disdir:
-# if u.pkg.changes["architecture"].has_key("source"):
-# session.execute("INSERT INTO disembargo (package, version) VALUES (:package, :version)", u.pkg.changes)
-# session.commit()
-#
-# ret = True
-#
-# session.close()
-#
-# return ret
-#
-#def queue_unembargo(u, summary, short_summary, session=None):
-# return package_to_queue(u, summary, short_summary, "Unembargoed",
-# perms=0660, build=True, announce='process-unchecked.accepted')
+ # If we dont have the disembargo queue we are not on security and so not interested
+ # in doing any security queue handling
+ if not get_policy_queue("disembargo"):
+ return False
+
+ q = session.execute("SELECT package FROM disembargo WHERE package = :source AND version = :version",
+ {'source': u.pkg.changes["source"],
+ 'version': u.pkg.changes["version"]})
+ if q.rowcount > 0:
+ session.close()
+ return True
+
+ oldcwd = os.getcwd()
+ os.chdir(cnf["Dir::Queue::Disembargo"])
+ disdir = os.getcwd()
+ os.chdir(oldcwd)
+
+ ret = False
+
+ if u.pkg.directory == disdir:
+ if u.pkg.changes["architecture"].has_key("source"):
+ session.execute("INSERT INTO disembargo (package, version) VALUES (:package, :version)",
+ {'source': u.pkg.changes["source"],
+ 'version': u.pkg.changes["version"]})
+ session.commit()
+
+ ret = True
+
+ session.close()
+
+ return ret
+
+def queue_unembargo(u, summary, short_summary, session=None):
+ return package_to_queue(u, summary, short_summary,
+ get_policy_queue('disembargo'), chg, session,
+ announce=None)