Page MenuHomePhabricator

/srv/mediawiki-staging/scap/plugins/clean.py had a live hack
Closed, ResolvedPublic

Description

For some reason, /srv/mediawiki-staging was in a dirty state on tin.eqiad.wmnet:
-rw-rw-r-- 1 thcipriani wikidev 4180 Feb 12 17:19 scap/plugins/clean.py

--- a/scap/plugins/clean.py
+++ b/scap/plugins/clean.py
@@ -97,7 +97,10 @@ class Clean(main.AbstractSync):
 
     def _maybe_delete(self, path):
         if os.path.exists(path):
-            shutil.rmtree(path)
+            if os.path.isdir(path):
+                shutil.rmtree(path)
+            else:
+                os.remove(path)
         else:
             self.get_logger().info(
                 'Unable to delete %s, already missing', path)

Event Timeline

hashar created this task.Feb 13 2018, 8:36 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 13 2018, 8:36 AM

Mentioned in SAL (#wikimedia-operations) [2018-02-13T08:37:17Z] <hashar> tin.eqiad.wmnet: removing live hack in /srv/mediawiki-staging/scap/plugins/clean.py | T187160

thcipriani closed this task as Resolved.Feb 13 2018, 3:45 PM
thcipriani assigned this task to hashar.
thcipriani added a subscriber: demon.

I guess somehow I created that file initially, but I haven't edited it in a good long while. I see @demon pruned wmf.17 last night so this was likely a hotfix that wasn't cleaned: https://tools.wmflabs.org/sal/log/AWGLCZW_kkJ8OkTwiAEW

Thank you for the cleanup @hashar !

demon added a comment.Feb 13 2018, 4:31 PM

Ugh, should've committed it instead....