Skip to content

mgr/vol: fix flake8 warnings - #54308

Merged
rishabh-d-dave merged 2 commits into
ceph:mainfrom
rishabh-d-dave:mgr-vol-flake-warnings
Nov 29, 2023
Merged

rishabh-d-dave merged 2 commits into
ceph:mainfrom
rishabh-d-dave:mgr-vol-flake-warnings

Conversation

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

Fix warnings printed by the command "flake8 --select=F,E9
--exclude=venv,.tox src/pybind/mgr/volumes/".

While working with mgr/vol, syntax errors are not printed anywhere. Any
attempt to run vstart.sh after such faulty patch causes vstart.sh to go
in a infinite loop. And running "ceph fs volume" command prints "no such
command exists". This doesn't tell the actual issue and causes
confusion.

When a flake8 is run, the issue is not apparent due to so many warnings.
Therefore, fix these warnings so that it becomes easier to spot such
critical issues here onwards.

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • 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 cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@rishabh-d-dave
rishabh-d-dave requested a review from a team November 2, 2023 15:56
@github-actions github-actions Bot added the pybind label Nov 2, 2023
@rishabh-d-dave

rishabh-d-dave commented Nov 3, 2023 •

Copy link
Copy Markdown
Contributor Author

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test make check

@vshankar

Copy link
Copy Markdown
Contributor

@rishabh-d-dave please run this through teuthology since an updated has been pushed lately.

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot added the mgr label Nov 13, 2023

@mchangir mchangir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mchangir

Copy link
Copy Markdown
Contributor

jenkins test make check

@neesingh-rh neesingh-rh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vshankar

Copy link
Copy Markdown
Contributor

@rishabh-d-dave ping?

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@neesingh-rh @vshankar

We can add this change https://github.com/ceph/ceph/pull/54396/files#r1386317911 into this. Rest LGTM

I created a separate PR because I wanted this one to be merged sooner.

@neesingh-rh

Copy link
Copy Markdown
Contributor

jenkins test make check

@rishabh-d-dave
rishabh-d-dave force-pushed the mgr-vol-flake-warnings branch 2 times, most recently from 80eb18a to 151ee12 Compare November 21, 2023 16:48
@rishabh-d-dave
rishabh-d-dave force-pushed the mgr-vol-flake-warnings branch 3 times, most recently from 649531a to 114fa34 Compare November 22, 2023 11:18
Writing guest keyring to CWD's file named "keyring" will over-write
build/keyring on developer's machine which will make the cluster
inoperatable and also fail the test.

Fixes: https://tracker.ceph.com/issues/63506
Signed-off-by: Rishabh Dave <[email protected]>
Fix warnings printed by the command "flake8 --select=F,E9
--exclude=venv,.tox src/pybind/mgr/volumes/".

While working with mgr/vol, syntax errors are not printed anywhere. Any
attempt to run vstart.sh after such faulty patch causes vstart.sh to go
in a infinite loop. And running "ceph fs volume" command prints "no such
command exists". This doesn't tell the actual issue and causes
confusion.

When flake8 is run, the issue is not immediately apparent due to so many
warnings. Therefore, fix these warnings so that it becomes easier to
spot such critical issues here onwards.

Note: mypy uses comments like "#type: Dict" for type checking and
therefore counts 'from typechecking import Dict' as not unsued. But
flake8 doesn't recognize type hints embedded in comment. Therfore,
switch to actually using type hints instead of adding type hints to
comments.

Signed-off-by: Rishabh Dave <[email protected]>
@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:======================================================================
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:ERROR: test_subvolume_group_quota_mds_path_restriction_to_group_path (tasks.cephfs.test_volumes.TestSubvolumeGroups)
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:Tests subvolumegroup quota enforcement with mds path restriction set to group.
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_90f297b062770cf2d9b04612fd691b6922a8a984/qa/tasks/cephfs/test_volumes.py", line 1129, in test_subvolume_group_quota_mds_path_restriction_to_group_path
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:    guest_keyring_path = self._configure_guest_auth(
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_90f297b062770cf2d9b04612fd691b6922a8a984/qa/tasks/cephfs/test_volumes.py", line 397, in _configure_guest_auth
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:    guest_mount.client_remote.write_file(guest_keyring_path, keyring_txt,
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_teuthology_2442239d2653456406c25ae0c71b689c8f2657b6/teuthology/orchestra/remote.py", line 295, in write_file
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:    self.run(args=args, stdin=data, quiet=True)
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_teuthology_2442239d2653456406c25ae0c71b689c8f2657b6/teuthology/orchestra/remote.py", line 522, in run
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:    r = self._runner(client=self.ssh, name=self.shortname, **kwargs)
2023-11-23T14:31:45.311 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_teuthology_2442239d2653456406c25ae0c71b689c8f2657b6/teuthology/orchestra/run.py", line 455, in run
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:    r.wait()
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_teuthology_2442239d2653456406c25ae0c71b689c8f2657b6/teuthology/orchestra/run.py", line 161, in wait
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:    self._raise_for_status()
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_teuthology_2442239d2653456406c25ae0c71b689c8f2657b6/teuthology/orchestra/run.py", line 181, in _raise_for_status
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:    raise CommandFailedError(
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:teuthology.exceptions.CommandFailedError: Command failed on smithi040 with status 1: 'set -ex\nsudo dd of=/tmp/tmp.h1A5IBnHAz'
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2023-11-23T14:31:45.312 INFO:tasks.cephfs_test_runner:Ran 37 tests in 1923.353s

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@rishabh-d-dave

Copy link
Copy Markdown
Contributor Author

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test windows

@vshankar
vshankar requested a review from kotreshhr November 29, 2023 15:49

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System mgr pybind tests wip-rishabh-testing Rishabh's testing label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants