ArielGlenn has submitted this change and it was merged.

Change subject: really fix getting last deployment date
......................................................................


really fix getting last deployment date

Change-Id: I420170c3e478ba68827db766eff5b962f620540f
---
M deployment/prep-dumps-deploy.py
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/deployment/prep-dumps-deploy.py b/deployment/prep-dumps-deploy.py
index fd09d1c..4885f1a 100644
--- a/deployment/prep-dumps-deploy.py
+++ b/deployment/prep-dumps-deploy.py
@@ -13,13 +13,14 @@
 def dateToDigits(dateString):
        if '-' not in dateString:
                return None
-       month, rest = dateString.split('-', 1)
+       month, day, year  = dateString.split('-', 2)
        if not month.isdigit():
                if not month in monthNames:
                        return None
                else:
-                       month = monthNames.index(month)
-       return "%s-%s" % ( int(month), rest)
+                       month = int(monthNames.index(month)) + 1
+               day = int(day)
+       return "%s%02d%02d" % ( year, month, day)
 
 def getLatestDeployDate(deploydir):
        try:
@@ -39,8 +40,7 @@
        if not len(deployDates.keys()):
                return None
        dates = deployDates.keys()
-       dates.sort()
-       dates.reverse()
+       dates.sort(reverse = True)
        return deployDates[dates[0]]
 
 # modified from the python copytree implementation
@@ -160,7 +160,7 @@
                
        fullPathSrc = os.path.join(deploydir,latestDeployDate)
 
-       print "Setting up deployment dir", fullPathDest
+       print "Setting up deployment dir", fullPathDest, "from", 
latestDeployDate
 
        if os.path.isdir(fullPathDest):
                print "New deployment dir already exists. overwrite, remove and 
copy, or skip [O/r/s]? ",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I420170c3e478ba68827db766eff5b962f620540f
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to