ArielGlenn has uploaded a new change for review.

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

Change subject: dumps: only show one list of dumps running
......................................................................

dumps: only show one list of dumps running

we generate multiple index html pages but only one of those
needs to display the list of running processes to console

Change-Id: Ia1231bc344c7a4eae1fbd2a19851a9e2bc622b60
---
M xmldumps-backup/monitor.py
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/74/215674/1

diff --git a/xmldumps-backup/monitor.py b/xmldumps-backup/monitor.py
index ea78b96..4dd9d43 100644
--- a/xmldumps-backup/monitor.py
+++ b/xmldumps-backup/monitor.py
@@ -10,7 +10,7 @@
     main, suffix = filename.split('.',1)
     return main + "-" + infix + ("." + suffix if suffix else "")
 
-def generateIndex(otherIndexhtml = None, sortedByDb=False):
+def generateIndex(otherIndexhtml = None, sortedByDb=False, showlocks=True):
        running = False
        states = []
        
@@ -24,13 +24,14 @@
                if wiki.isStale():
                        print dbName + " is stale"
                        wiki.cleanupStaleLock()
-               if wiki.isLocked():
-                    try:
+                if showlocks:
+                    if wiki.isLocked():
+                        try:
                             f = open( wiki.lockFile(), 'r' )
                             (host, pid) = f.readline().split(" ") 
                             f.close()
                             print dbName, "is locked by pid", pid, "on", host 
-                    except: 
+                        except:
                             print dbName, "is locked" 
                running = running or wiki.isLocked()
                states.append(wiki.statusLine())
@@ -70,7 +71,7 @@
 
        tempFilename = outputFileNameSortedByDb + ".tmp"
        file = open(tempFilename, "wt")
-       file.write(generateIndex(otherIndexhtml=outputFileName, 
sortedByDb=True))
+       file.write(generateIndex(otherIndexhtml=outputFileName, 
sortedByDb=True, showlocks=False))
        file.close()
        os.rename(tempFilename, outputFileNameSortedByDb)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1231bc344c7a4eae1fbd2a19851a9e2bc622b60
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to