From: Niels Thykier Date: Thu, 31 Dec 2015 11:14:34 +0000 (+0000) Subject: dominate: Do not attempt delete rows during dry-run X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=commitdiff_plain;h=41683a11b08d93c712b5683f87cdc1fca0ee354d;hp=5b520e89c57dfc268c2e32a88b4e5b4b7ec4333c dominate: Do not attempt delete rows during dry-run Without the proper permissions, this will fail even if the transaction would always be rolled back later. --- diff --git a/dak/dominate.py b/dak/dominate.py index 600d1127..52f1b172 100755 --- a/dak/dominate.py +++ b/dak/dominate.py @@ -84,12 +84,13 @@ def obsoleteAllAssociations(suite, session): return fetch('old_and_unreferenced', query, { 'suite': suite }, session) def deleteAssociations(table, idList, session): + global Options query = """ DELETE FROM %s WHERE id IN :idList """ % table - if not idList: + if not idList or Options['No-Action']: return params = {'idList': tuple(idList)} session.execute(query, params)