jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/340250 )

Change subject: Scap clean: abort if a branch is still in use
......................................................................


Scap clean: abort if a branch is still in use

It's easy to accidentally hose the whole site if we don't validate
our input first :)

Change-Id: Id7c77b6cc9f16736b57bba88740de82ba8b6d2a9
---
M scap/plugins/clean.py
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Thcipriani: Looks good to me, but someone else must approve
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scap/plugins/clean.py b/scap/plugins/clean.py
index 50116eb..83e8712 100644
--- a/scap/plugins/clean.py
+++ b/scap/plugins/clean.py
@@ -34,6 +34,9 @@
                   help='Only keep static assets (CSS/JS and the like).')
     def main(self, *extra_args):
         """ Clean old branches from the cluster for space savings! """
+        if self.arguments.branch in self.active_wikiversions():
+            raise ValueError('Branch "%s" is still in use, aborting' %
+                             self.arguments.branch)
         self.cleanup_branch(self.arguments.branch, self.arguments.keep_static)
 
     def cleanup_branch(self, branch, keep_static):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id7c77b6cc9f16736b57bba88740de82ba8b6d2a9
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Thcipriani <tcipri...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to