From: Gokcen Iskender Date: Fri, 1 Oct 2021 21:59:06 +0000 (-0700) Subject: mgr/volumes/fs/operations: fix various flake8 issues X-Git-Tag: v17.1.0~758^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=364d38e26aa202d91c33fede80463e98411bdaba;p=ceph-ci.git mgr/volumes/fs/operations: fix various flake8 issues Fixes: https://tracker.ceph.com/issues/51398 Signed-off-by: Gokcen Iskender --- diff --git a/src/pybind/mgr/volumes/fs/operations/subvolume.py b/src/pybind/mgr/volumes/fs/operations/subvolume.py index dc36477b54e..eed34db6ee2 100644 --- a/src/pybind/mgr/volumes/fs/operations/subvolume.py +++ b/src/pybind/mgr/volumes/fs/operations/subvolume.py @@ -1,8 +1,5 @@ -import os -import errno from contextlib import contextmanager -from ..exception import VolumeException from .template import SubvolumeOpType from .versions import loaded_subvolumes @@ -25,6 +22,7 @@ def create_subvol(mgr, fs, vol_spec, group, subvolname, size, isolate_nspace, po subvolume = loaded_subvolumes.get_subvolume_object_max(mgr, fs, vol_spec, group, subvolname) subvolume.create(size, isolate_nspace, pool, mode, uid, gid) + def create_clone(mgr, fs, vol_spec, group, subvolname, pool, source_volume, source_subvolume, snapname): """ create a cloned subvolume. @@ -42,6 +40,7 @@ def create_clone(mgr, fs, vol_spec, group, subvolname, pool, source_volume, sour subvolume = loaded_subvolumes.get_subvolume_object_max(mgr, fs, vol_spec, group, subvolname) subvolume.create_clone(pool, source_volume, source_subvolume, snapname) + def remove_subvol(mgr, fs, vol_spec, group, subvolname, force=False, retainsnaps=False): """ remove a subvolume. @@ -57,6 +56,7 @@ def remove_subvol(mgr, fs, vol_spec, group, subvolname, force=False, retainsnaps with open_subvol(mgr, fs, vol_spec, group, subvolname, op_type) as subvolume: subvolume.remove(retainsnaps) + @contextmanager def open_subvol(mgr, fs, vol_spec, group, subvolname, op_type): """