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/?a=commitdiff_plain;h=41683a11b08d93c712b5683f87cdc1fca0ee354d;p=dak.git 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)