]> 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>
Thu, 23 Nov 2023 18:46:40 +0000 (00:16 +0530)
commit95dac209a2e0788dce490f64645ff5d5a17fdfb9
tree0d0b0e919c6b8d7207663ce25b41d9d9b4a39617
parent974c4f93b3cc485e9fd340d9e7d5d13948ab25f7
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>
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