From 364d38e26aa202d91c33fede80463e98411bdaba Mon Sep 17 00:00:00 2001 From: Gokcen Iskender Date: Fri, 1 Oct 2021 14:59:06 -0700 Subject: [PATCH] mgr/volumes/fs/operations: fix various flake8 issues Fixes: https://tracker.ceph.com/issues/51398 Signed-off-by: Gokcen Iskender --- src/pybind/mgr/volumes/fs/operations/subvolume.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/volumes/fs/operations/subvolume.py b/src/pybind/mgr/volumes/fs/operations/subvolume.py index dc36477b54ed6..eed34db6ee2e5 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): """ -- 2.39.5