ArielGlenn has submitted this change and it was merged.
Change subject: pep8 fixup: remove extra spaces pylint cleanup: work around no
method overrides in python
......................................................................
pep8 fixup: remove extra spaces
pylint cleanup: work around no method overrides in python
Change-Id: I316871b42f5feca9f1ae14eb6c00d34a34c7798d
---
M dataretention/retention/fileinfo.py
M dataretention/retention/ignores.py
M dataretention/retention/localfileaudit.py
M dataretention/retention/locallogaudit.py
4 files changed, 16 insertions(+), 20 deletions(-)
Approvals:
ArielGlenn: Verified; Looks good to me, approved
diff --git a/dataretention/retention/fileinfo.py
b/dataretention/retention/fileinfo.py
index 122c18c..1d6f641 100644
--- a/dataretention/retention/fileinfo.py
+++ b/dataretention/retention/fileinfo.py
@@ -466,13 +466,15 @@
is_old = -1
return is_old
- def load_file_info(self, from_time, cutoff, open_files=None):
- if open_files is None:
- open_files = []
+ def load_file_info(self):
self.get_stats()
self.get_is_empty()
- self.get_is_old(from_time, cutoff)
self.get_filetype()
+
+ def load_extra_file_info(self, from_time, cutoff, open_files=None):
+ if open_files is None:
+ open_files = []
+ self.get_is_old(from_time, cutoff)
self.get_is_open(open_files)
def produce_dict(self):
@@ -552,16 +554,7 @@
self.rotated = None
self.notifempty = None
- def load_file_info(self, from_time, cutoff, open_files=None, rotated=None):
- if rotated is None:
- rotated = []
- if open_files is None:
- open_files = []
- super(LogInfo, self).load_file_info(from_time, cutoff, open_files)
- self.get_rotated(rotated)
-
def get_rotated(self, rotated_files):
-
if self.normalized_path in rotated_files:
self.rotated = 'T(%s/%s)' % (
rotated_files[self.normalized_path][0],
diff --git a/dataretention/retention/ignores.py
b/dataretention/retention/ignores.py
index 622087f..3b34d3f 100644
--- a/dataretention/retention/ignores.py
+++ b/dataretention/retention/ignores.py
@@ -101,19 +101,19 @@
basename = os.path.basename(fname)
if 'prefixes' in ignored:
- if check_file_ignoredtype(
+ if check_file_ignoredtype(
ignored, 'prefixes', clouseau.retention.fileutils.startswith,
basename, basedir):
return True
if 'extensions' in ignored:
- if check_file_ignoredtype(
+ if check_file_ignoredtype(
ignored, 'extensions', clouseau.retention.fileutils.endswith,
basename, basedir):
return True
if 'files' in ignored:
- if check_file_ignoredtype(
+ if check_file_ignoredtype(
ignored, 'files', clouseau.retention.fileutils.endswith,
basename, basedir):
return True
diff --git a/dataretention/retention/localfileaudit.py
b/dataretention/retention/localfileaudit.py
index c2a0f18..446d4e9 100644
--- a/dataretention/retention/localfileaudit.py
+++ b/dataretention/retention/localfileaudit.py
@@ -324,9 +324,10 @@
today = time.time()
for (fname, fstat) in files:
all_files[fname] = FileInfo(fname, magic, fstat)
- all_files[fname].load_file_info(today,
-
clouseau.retention.config.conf['cutoff'],
- open_files)
+ all_files[fname].load_file_info()
+ all_files[fname].load_extra_file_info(today,
+
clouseau.retention.config.conf['cutoff'],
+ open_files)
all_files_sorted = sorted(all_files, key=lambda f: all_files[f].path)
result = []
diff --git a/dataretention/retention/locallogaudit.py
b/dataretention/retention/locallogaudit.py
index a264a5d..da10af5 100644
--- a/dataretention/retention/locallogaudit.py
+++ b/dataretention/retention/locallogaudit.py
@@ -290,7 +290,9 @@
today = time.time()
for (fname, stat) in files:
all_files[fname] = LogInfo(fname, magic, stat)
- all_files[fname].load_file_info(today, cutoff, open_files, rotated)
+ all_files[fname].load_file_info()
+ all_files[fname].load_extra_file_info(today, cutoff, open_files)
+ all_files[fname].get_rotated(rotated)
return all_files
def do_local_audit(self):
--
To view, visit https://gerrit.wikimedia.org/r/233474
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I316871b42f5feca9f1ae14eb6c00d34a34c7798d
Gerrit-PatchSet: 2
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits