[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] 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.
---
 dak/dominate.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dak/dominate.py b/dak/dominate.py
index 600d112..52f1b17 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)
-- 
2.1.4


Reply to: