Skip to content

Commit

Permalink
mgr/volumes: place getters and setters next to each other
Browse files Browse the repository at this point in the history
workaround for mypy issue:
python/mypy#1465

fixes mypy errors:

volumes/fs/operations/group.py: note: In class "Group":
volumes/fs/operations/group.py:44: error: Name 'uid' already defined on line 36
volumes/fs/operations/group.py:44: error: "Callable[[Group], Any]" has no attribute "setter"
volumes/fs/operations/group.py:48: error: Name 'gid' already defined on line 40
volumes/fs/operations/group.py:48: error: "Callable[[Group], Any]" has no attribute "setter"

volumes/fs/operations/group.py: note: In function "open_group":
volumes/fs/operations/group.py:170: error: Property "uid" defined in "Group" is read-only
volumes/fs/operations/group.py:171: error: Property "gid" defined in "Group" is read-only

volumes/fs/operations/versions/subvolume_base.py: note: In class "SubvolumeBase":
volumes/fs/operations/versions/subvolume_base.py:45: error: Name 'uid' already defined on line 33
volumes/fs/operations/versions/subvolume_base.py:45: error: "Callable[[SubvolumeBase], Any]" has no attribute "setter"
volumes/fs/operations/versions/subvolume_base.py:49: error: Name 'gid' already defined on line 37
volumes/fs/operations/versions/subvolume_base.py:49: error: "Callable[[SubvolumeBase], Any]" has no attribute "setter"
volumes/fs/operations/versions/subvolume_base.py:53: error: Name 'mode' already defined on line 41
volumes/fs/operations/versions/subvolume_base.py:53: error: "Callable[[SubvolumeBase], Any]" has no attribute "setter"

Signed-off-by: Michael Fritch <mfritch@suse.com>
  • Loading branch information
mgfritch authored and vshankar committed Mar 3, 2020
1 parent 3589bf4 commit c4d8a26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/pybind/mgr/volumes/fs/operations/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def group_name(self):
def uid(self):
return self.user_id

@property
def gid(self):
return self.group_id

@uid.setter
def uid(self, val):
self.user_id = val

@property
def gid(self):
return self.group_id

@gid.setter
def gid(self, val):
self.group_id = val
Expand Down
16 changes: 8 additions & 8 deletions src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ def __init__(self, fs, vol_spec, group, subvolname, legacy=False):
def uid(self):
return self.user_id

@property
def gid(self):
return self.group_id

@property
def mode(self):
return self.cmode

@uid.setter
def uid(self, val):
self.user_id = val

@property
def gid(self):
return self.group_id

@gid.setter
def gid(self, val):
self.group_id = val

@property
def mode(self):
return self.cmode

@mode.setter
def mode(self, val):
self.cmode = val
Expand Down

0 comments on commit c4d8a26

Please sign in to comment.