Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flake 8 style warnings (issue #7925) #7952

Merged
merged 1 commit into from Sep 26, 2018

Conversation

GregorKopka
Copy link
Contributor

Motivation and Context

Issue #7925

Description

Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:

  • 'maxint' -> 'maxsize' that 2to3 missed.
  • 'cmp=' parameter for a 'sorted()' with a 'key=' version.
  • try/except wrapping of configparser import as there are still
    python 2.7 systems that lack a compatibility shim

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
@codecov
Copy link

codecov bot commented Sep 25, 2018

Codecov Report

Merging #7952 into master will increase coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7952      +/-   ##
==========================================
+ Coverage   78.49%    78.6%   +0.11%     
==========================================
  Files         376      376              
  Lines      114030   114030              
==========================================
+ Hits        89508    89634     +126     
+ Misses      24522    24396     -126
Flag Coverage Δ
#kernel 78.85% <ø> (+0.07%) ⬆️
#user 67.83% <ø> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7165d7...3c01f4e. Read the comment docs.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix. I verified this is now working as expected on all of the TEST builders.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Sep 25, 2018
@behlendorf
Copy link
Contributor

@GregorKopka are there any remaining concerns that this won't work with python 2.6? The CentOS 6 builder appears to be fine, but I wanted to double check.

@GregorKopka
Copy link
Contributor Author

GregorKopka commented Sep 26, 2018

@behlendorf As I buried my last python 2.6 installation over half a decade ago I have no way to test them on an actual living interpreter - should you feel unsure you might have to ask someone who is either versed in necromancy or has access to a system with 2.6 to test it there.

That being said, as the changes I made to make the scripts compatible with python 3 don't use any new constructs or language features, no external stuff (apart from the configparser module name) was touched and they run on the CentOS 6 builders... it should be fine.

@behlendorf
Copy link
Contributor

Since everything does work on the CentOS 6 builder, I'm good with this.

@behlendorf behlendorf merged commit 3ed2fbc into openzfs:master Sep 26, 2018
GregorKopka added a commit to GregorKopka/zfs that referenced this pull request Jan 7, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925 
Closes openzfs#7952
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 13, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
Closes openzfs#7952
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 19, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
Closes openzfs#7952
tonyhutter pushed a commit that referenced this pull request Mar 4, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes #7925
Closes #7952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants