ArielGlenn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/285365
Change subject: get_stub_files expects an int arg for file part number
......................................................................
get_stub_files expects an int arg for file part number
document this and make sure all calls to it pass the correct type
Change-Id: Ia3739fe8ebe6fc74d1256bd6b8d5fd4174b6f42d
---
M xmldumps-backup/dumps/xmljobs.py
1 file changed, 14 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/dumps
refs/changes/65/285365/1
diff --git a/xmldumps-backup/dumps/xmljobs.py b/xmldumps-backup/dumps/xmljobs.py
index c364041..e08443b 100644
--- a/xmldumps-backup/dumps/xmljobs.py
+++ b/xmldumps-backup/dumps/xmljobs.py
@@ -216,17 +216,21 @@
return "bz2"
def get_stub_files(self, runner, partnum=None):
- # just get the files pertaining to our dumpname, which is *one* of
- # articles, pages-current, pages-history.
- # stubs include all of them together.
+ '''
+ get the stun files pertaining to our dumpname, which is *one* of
+ articles, pages-current, pages-history.
+ stubs include all of these together.
+ we will either return the one full stubs file that exists
+ or the one stub file part, if we are (re)running a specific
+ file part (subjob), or all file parts if we are (re)running
+ the entire job which is configured for subjobs.
+ arguments:
+ runner - Runner object
+ partnum (int) - number of file part (subjob) if any
+ '''
if partnum is None:
partnum = self._partnum_todo
-
- # we will either return the one full stubs file that exists
- # or the one stub file part, if we are (re)running a specific
- # file part (subjob), or all file parts if we are (re)running
- # the entire job which is configured for subjobs.
if not self.dumpname.startswith(self.get_dumpname_base()):
raise BackupError("dumpname %s of unknown form for this job" %
self.dumpname)
@@ -239,7 +243,7 @@
if self._parts_enabled:
if partnum is not None:
for inp_file in input_files:
- if inp_file.partnum == partnum:
+ if inp_file.partnum_int == partnum:
input_files = [inp_file]
break
return input_files
@@ -412,7 +416,7 @@
print "todo is", [to.filename for to in todo]
for fileobj in todo:
- stub_for_file = self.get_stub_files(runner, fileobj.partnum)[0]
+ stub_for_file = self.get_stub_files(runner, fileobj.partnum_int)[0]
if fileobj.first_page_id is None:
partial_stubs.append(stub_for_file)
--
To view, visit https://gerrit.wikimedia.org/r/285365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3739fe8ebe6fc74d1256bd6b8d5fd4174b6f42d
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