ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365564 )

Change subject: fix construction of path for api calls
......................................................................

fix construction of path for api calls

Bug: T170741
Change-Id: Idc58434723284c7af07ef5b65137cf654d2a9450
---
M xmldumps-backup/dumps/apijobs.py
M xmldumps-backup/dumps/utils.py
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/64/365564/1

diff --git a/xmldumps-backup/dumps/apijobs.py b/xmldumps-backup/dumps/apijobs.py
index 341be04..612e17b 100644
--- a/xmldumps-backup/dumps/apijobs.py
+++ b/xmldumps-backup/dumps/apijobs.py
@@ -48,7 +48,7 @@
         #         &siprop=namespaces|namespacealiases|magicwords&format=json
         base_url = runner.db_server_info.apibase
         properties = '|'.join(self._properties)
-        api_url = 
"{baseurl}/api.php?action=query&meta=siteinfo&siprop={props}&format=json"
+        api_url = 
"{baseurl}?action=query&meta=siteinfo&siprop={props}&format=json"
         url = api_url.format(baseurl=base_url, props=properties)
         command = [["/usr/bin/curl", "-s", url]]
         return command
diff --git a/xmldumps-backup/dumps/utils.py b/xmldumps-backup/dumps/utils.py
index 74c79d9..c782931 100644
--- a/xmldumps-backup/dumps/utils.py
+++ b/xmldumps-backup/dumps/utils.py
@@ -152,7 +152,7 @@
         if wgcanonserver is None or wgscriptpath is None:
             raise BackupError("Failed to get apibase for %s, bailing."
                               % self.wiki.config.php)
-        self.apibase = "/".join([wgcanonserver, wgscriptpath, "api.php"])
+        self.apibase = "/".join([wgcanonserver.rstrip('/'), 
wgscriptpath.strip('/'), "api.php"])
 
     def mysql_standard_parameters(self):
         host = self.db_server

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

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

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

Reply via email to