Giuseppe Lavagetto has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311678

Change subject: Have confctl exit with status code 1 if one action fails.
......................................................................

Have confctl exit with status code 1 if one action fails.

Change-Id: Ib389e31beff8ac758848c24a54014c9c5718ced3
---
M conftool/cli/tool.py
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/conftool 
refs/changes/78/311678/1

diff --git a/conftool/cli/tool.py b/conftool/cli/tool.py
index 7d850aa..63cad8f 100644
--- a/conftool/cli/tool.py
+++ b/conftool/cli/tool.py
@@ -113,6 +113,9 @@
                 print(msg)
         if not fail:
             self.announce()
+            return True
+        else:
+            return False
 
     @staticmethod
     def raise_warning():
@@ -282,9 +285,12 @@
         _log.critical("Invalid configuration: %s", e)
         sys.exit(1)
 
+    exit_status = 0
     for unit in args.action:
         # TODO: fix base class
-        cli.run_action(unit)
+        if not cli.run_action(unit):
+            exit_status = 1
+    sys.exit(exit_status)
 
 
 if __name__ == '__main__':

-- 
To view, visit https://gerrit.wikimedia.org/r/311678
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib389e31beff8ac758848c24a54014c9c5718ced3
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/conftool
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to