Browse Source

inspur: transfer 'rw' to 'rwx' when Shared File Systems protocol is cifs

'rw' means is read\write\create\delete file in manila.
But it is only read\write file in AS13000.
The 'rwx' in AS13000 does the same thing as 'rw' in manila.

Co-Authored-By: Brin Zhang <zhangbailin@inspur.com>

Closes-Bug: #1797291
Change-Id: Id1453e86f3179ef5bca3e349c6e7c58ff7f991c8
changes/55/607455/8
shaoxj 3 years ago
committed by zhangbailin
parent
commit
9f06403d73
  1. 5
      manila/share/drivers/inspur/as13000/as13000_nas.py
  2. 6
      manila/tests/share/drivers/inspur/as13000/test_as13000_nas.py
  3. 4
      releasenotes/notes/inspur-support-rwx-for-cifs-permission-4279f1fe7a59fd00.yaml

5
manila/share/drivers/inspur/as13000/as13000_nas.py

@ -464,9 +464,12 @@ class AS13000ShareDriver(driver.ShareDriver):
@staticmethod
def transfer_rule_to_client(proto, rule):
"""transfer manila access rule to backend client"""
access_level = rule['access_level']
if proto == 'cifs' and access_level == 'rw':
access_level = 'rwx'
return dict(name=rule['access_to'],
type=(0 if proto == 'nfs' else 1),
authority=rule['access_level'])
authority=access_level)
@inspur_driver_debug_trace
def update_access(self, context, share, access_rules, add_rules,

6
manila/tests/share/drivers/inspur/as13000/test_as13000_nas.py

@ -646,13 +646,15 @@ class AS13000ShareDriverTestCase(test.TestCase):
mock_gsfs.assert_called_once_with('/P/share_fakeinstanceid')
mock_rest.assert_not_called()
@ddt.data('nfs', 'icfs')
@ddt.data('nfs', 'icfs', 'cifs')
def test_transfer_rule_to_client(self, proto):
rule = {'access_to': '1.1.1.1', 'access_level': 'rw'}
result = self.driver.transfer_rule_to_client(proto, rule)
client = {'name': '1.1.1.1', 'authority': 'rw'}
client = {'name': '1.1.1.1',
'authority': 'rwx' if proto == 'cifs' else 'rw'}
if proto == 'nfs':
client.update({'type': 0})
else:

4
releasenotes/notes/inspur-support-rwx-for-cifs-permission-4279f1fe7a59fd00.yaml

@ -0,0 +1,4 @@
---
fixes:
- Fixed CIFS permission issue with Inspur AS13000 driver so that files and
folders can be created and deleted correctly.
Loading…
Cancel
Save