Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/volume: Python flake warning fixes. #52208

Closed
wants to merge 11 commits into from
67 changes: 35 additions & 32 deletions src/pybind/mgr/volumes/fs/operations/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ..exception import VolumeException


class GroupTemplate(object):
def list_subvolumes(self):
raise VolumeException(-errno.ENOTSUP, "operation not supported.")
Expand Down Expand Up @@ -35,42 +36,44 @@ def list_snapshots(self):
"""
raise VolumeException(-errno.ENOTSUP, "operation not supported.")


@unique
class SubvolumeOpType(Enum):
CREATE = 'create'
REMOVE = 'rm'
REMOVE_FORCE = 'rm-force'
PIN = 'pin'
LIST = 'ls'
GETPATH = 'getpath'
INFO = 'info'
RESIZE = 'resize'
SNAP_CREATE = 'snap-create'
SNAP_REMOVE = 'snap-rm'
SNAP_LIST = 'snap-ls'
SNAP_INFO = 'snap-info'
SNAP_PROTECT = 'snap-protect'
SNAP_UNPROTECT = 'snap-unprotect'
CLONE_SOURCE = 'clone-source'
CLONE_CREATE = 'clone-create'
CLONE_STATUS = 'clone-status'
CLONE_CANCEL = 'clone-cancel'
CLONE_INTERNAL = 'clone_internal'
ALLOW_ACCESS = 'allow-access'
DENY_ACCESS = 'deny-access'
AUTH_LIST = 'auth-list'
EVICT = 'evict'
USER_METADATA_SET = 'user-metadata-set'
USER_METADATA_GET = 'user-metadata-get'
USER_METADATA_LIST = 'user-metadata-ls'
USER_METADATA_REMOVE = 'user-metadata-rm'
SNAP_METADATA_SET = 'snap-metadata-set'
SNAP_METADATA_GET = 'snap-metadata-get'
SNAP_METADATA_LIST = 'snap-metadata-ls'
SNAP_METADATA_REMOVE = 'snap-metadata-rm'
CREATE = 'create'
REMOVE = 'rm'
REMOVE_FORCE = 'rm-force'
Comment on lines -40 to +44
Copy link
Contributor

Choose a reason for hiding this comment

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

This formatting was deliberately this way for sake of readability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason pep8 style guide does not recommend aligning = signs is that sooner or later, you will get a longer variable, which causes you to re-align all those = symbols. It is subjective if aligned = is more readable or not. Given that we have a tracker issue and we want it to be fixed, which means we want to adhere to pep8, I have fixed it. If not we can close the PR.

PIN = 'pin'
LIST = 'ls'
GETPATH = 'getpath'
INFO = 'info'
RESIZE = 'resize'
SNAP_CREATE = 'snap-create'
SNAP_REMOVE = 'snap-rm'
SNAP_LIST = 'snap-ls'
SNAP_INFO = 'snap-info'
SNAP_PROTECT = 'snap-protect'
SNAP_UNPROTECT = 'snap-unprotect'
CLONE_SOURCE = 'clone-source'
CLONE_CREATE = 'clone-create'
CLONE_STATUS = 'clone-status'
CLONE_CANCEL = 'clone-cancel'
CLONE_INTERNAL = 'clone_internal'
ALLOW_ACCESS = 'allow-access'
DENY_ACCESS = 'deny-access'
AUTH_LIST = 'auth-list'
EVICT = 'evict'
USER_METADATA_SET = 'user-metadata-set'
USER_METADATA_GET = 'user-metadata-get'
USER_METADATA_LIST = 'user-metadata-ls'
USER_METADATA_REMOVE = 'user-metadata-rm'
SNAP_METADATA_SET = 'snap-metadata-set'
SNAP_METADATA_GET = 'snap-metadata-get'
SNAP_METADATA_LIST = 'snap-metadata-ls'
SNAP_METADATA_REMOVE = 'snap-metadata-rm'


class SubvolumeTemplate(object):
VERSION = None # type: int
VERSION = None # type: int

@staticmethod
def version():
Expand Down