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

cephfs-shell: Fix flake8 errors (E302, E502, E128, F821, W605, 5128, E122) #34254

Closed
wants to merge 8 commits into from
Closed

cephfs-shell: Fix flake8 errors (E302, E502, E128, F821, W605, 5128, E122) #34254

wants to merge 8 commits into from

Conversation

me-diru
Copy link

@me-diru me-diru commented Mar 27, 2020

cephfs-shell: Fix flake8 errors (E302, E502, E128, F821, W605, 5128, E122)

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit rohitdandamudi.1100@gmail.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

This patch fixes the following flake8 error:
    E302 expected 2 blank lines, found 1
Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
   E502 the backslash is redundant between brackets

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
    E302 expected 2 blank lines, found 1

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
    E128 continuation line under-indented for visual indent

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
    F821 undefined name 'e'

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
    W605 invalid escape sequence '\A'

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
    E128 continuation line under-indented for visual indent

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
This patch fixes the following flake8 error:
    E122 continuation line missing indentation or outdented

Fixes: https://tracker.ceph.com/issues/44645
Signed-off-by: Dandamudi Rohit <rohitdandamudi.1100@gmail.com>
@me-diru
Copy link
Author

me-diru commented Mar 27, 2020

Hello @varshar16

Can you please have a look at it. Also the W605 didn't appear when I ran flake8 command, but corrected it anyway.

Thanks

Copy link
Contributor

@varshar16 varshar16 left a comment

Choose a reason for hiding this comment

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

The following changes are required:

  1. In commit cf2cb51, add a blank line before Fixes.
  2. Use imperative mood in commits.
  3. Merge commits fixing same error type.

Check the log for examples.
Refer this doc: https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#commit-title

@@ -136,6 +136,7 @@ def ls(path, opts=''):
perror(e)
shell.exit_code = e.get_error_code()


Copy link
Contributor

Choose a reason for hiding this comment

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

Move this change to a different commit.

@@ -1357,7 +1357,6 @@ class CephFSShell(Cmd):
else:
self.perror("snapshot can only be created or deleted; check - "
"help snap")
self.exit_code = e.get_error_code()
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is wrong. Exit code is required and it should return 1 here .

@varshar16
Copy link
Contributor

Please fix these errors too:

../src/tools/cephfs/cephfs-shell:1135:48: E226 missing whitespace around arithmetic operator
../src/tools/cephfs/cephfs-shell:1140:40: E226 missing whitespace around arithmetic operator

@me-diru me-diru closed this Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants