]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/vol: fix flake8 warnings
authorRishabh Dave <ridave@redhat.com>
Thu, 2 Nov 2023 15:15:27 +0000 (20:45 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 22 Mar 2024 16:57:35 +0000 (22:27 +0530)
commit719e83baed793ef515641c70d8bea7b236d98e39
tree541e15a0992f267b221bdef42d39957a17f9b4d1
parenta98b28d9a70ce345d210079ee59994e1137c3b28
mgr/vol: fix flake8 warnings

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 <ridave@redhat.com>
(cherry picked from commit 95dac209a2e0788dce490f64645ff5d5a17fdfb9)
13 files changed:
src/pybind/mgr/volumes/fs/async_cloner.py
src/pybind/mgr/volumes/fs/operations/access.py
src/pybind/mgr/volumes/fs/operations/lock.py
src/pybind/mgr/volumes/fs/operations/pin_util.py
src/pybind/mgr/volumes/fs/operations/trash.py
src/pybind/mgr/volumes/fs/operations/versions/__init__.py
src/pybind/mgr/volumes/fs/operations/versions/metadata_manager.py
src/pybind/mgr/volumes/fs/operations/versions/op_sm.py
src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py
src/pybind/mgr/volumes/fs/operations/volume.py
src/pybind/mgr/volumes/fs/volume.py