]> git.decadent.org.uk Git - dak.git/commitdiff
dominate: Do not open log files with -n
authorNiels Thykier <niels@thykier.net>
Tue, 29 Dec 2015 22:02:40 +0000 (22:02 +0000)
committerNiels Thykier <niels@thykier.net>
Thu, 31 Dec 2015 11:13:28 +0000 (11:13 +0000)
Signed-off-by: Niels Thykier <niels@thykier.net>
dak/dominate.py

index 449b9595949f5cf830a8a9c130b56b00e7655357..accb0df8f628efce999ad82121d8140565df4d66 100755 (executable)
@@ -140,7 +140,8 @@ def main():
         suites = [suite.suite_name for suite in query_suites]
         cnf['Obsolete::Options::Suite'] = str(','.join(suites))
 
-    Logger = daklog.Logger("dominate")
+    if not Options['No-Action']:
+       Logger = daklog.Logger("dominate")
     session = DBConn().session()
     for suite_name in utils.split_args(Options['Suite']):
         suite = session.query(Suite).filter_by(suite_name = suite_name).one()
@@ -156,7 +157,8 @@ def main():
         session.rollback()
     else:
         session.commit()
-    Logger.close()
+    if Logger:
+        Logger.close()
 
 if __name__ == '__main__':
     main()