Kill a bunch of unused variables
AbandonedPublic

Authored by demon on Oct 24 2017, 1:52 AM.

Details

Reviewers
mmodell
hashar
Group Reviewers
Release-Engineering-Team
Patch without arc
git checkout -b D837 && curl -L https://phabricator.wikimedia.org/D837?download=true | git apply

Diff Detail

demon created this revision.Oct 24 2017, 1:52 AM
Restricted Application added a reviewer: mmodell. · View Herald TranscriptOct 24 2017, 1:52 AM
Restricted Application added a reviewer: Release-Engineering-Team. · View Herald Transcript
Restricted Application added a project: Release-Engineering-Team. · View Herald Transcript
mmodell accepted this revision.Oct 24 2017, 8:08 AM
This revision is now accepted and ready to land.Oct 24 2017, 8:08 AM
hashar requested changes to this revision.Oct 24 2017, 9:02 AM
hashar added a subscriber: hashar.

There are a bunch that can be fixed in a nicer way.

Then I am not sure I am much a fan of that pylint check. _ is often meaningless. Typically:

for (fd, event) in epoll.poll(0.01)
for (fd, _) in epoll.poll(0.01)

There we dont know anymore that the second is an event. But I must be nitpicking.

scap/cdblib.py
208

In python 2 xrange returns an object and in python3 it has been removed.

One can instead use range which in python 2 returns a list while in python3 returns an object.

A python2/3 compatible code would be:

self._unordered = list(range(0,256))

On python2 that yields a list converted to a list. On python3 a range converted to a list.

scap/deploy.py
714

Since we only care about the dictionary values:

for group in list(self.deploy_groups.values())

That is python2 / python3 compatible. dict.values() in python2 it returns a list, in python 3 it returns a dict_values which has to be converted to a list.

scap/main.py
91

Might has well adjust to log the number of succeeded ? Maybe something like:

self.get_logger().warning(
    '%d canaries had sync errors. %d succeeded', failed, succeeded)
151

Ditto, maybe consider logging # of succeeded.

173

Ditto, maybe consider logging # of succeeded.

209

Since we only care of the dictionary keys:

for version in list(self.active_wikiversions().keys()):

Which is python 2 / python 3 compatible. Same as for dict.values() earlier.

431
for version in list(self.versions.values()):
754
for version in list(self.active_wikiversions().keys()):
This revision now requires changes to proceed.Oct 24 2017, 9:02 AM
demon abandoned this revision.Oct 24 2017, 2:50 PM