[NetApp] Fix access rules for CIFS promoted replica

This patch fixes the access rules for NetApp promote replica when
using CIFS protocol. When promoting a replica, the NetApp ONTAP
driver updates the access rules for the promoted CIFS share entity
before actually creating it, failing on having those rules
applied.

The bug is fixed by switching the order of updating the access
and creating the promoted CIFS share entity.

Change-Id: I60e4057dc962d96cff57dea88587a28c2043b499
Closes-Bug: #1896949
(cherry picked from commit 0c4d1e3398)
(cherry picked from commit c857b94e8a)
This commit is contained in:
Felipe Rodrigues 2020-09-24 12:22:20 +00:00 committed by Douglas Viroel
parent 9828e16968
commit 460f44704d
2 changed files with 10 additions and 2 deletions

View File

@ -2103,6 +2103,9 @@ class NetAppCmodeFileStorageLibrary(object):
# 3. Setup access rules # 3. Setup access rules
new_active_replica = replica.copy() new_active_replica = replica.copy()
new_active_replica['export_locations'] = self._create_export(
new_active_replica, share_server, vserver, vserver_client)
helper = self._get_helper(replica) helper = self._get_helper(replica)
helper.set_client(vserver_client) helper.set_client(vserver_client)
try: try:
@ -2113,8 +2116,6 @@ class NetAppCmodeFileStorageLibrary(object):
else: else:
new_active_replica['access_rules_status'] = constants.STATUS_ACTIVE new_active_replica['access_rules_status'] = constants.STATUS_ACTIVE
new_active_replica['export_locations'] = self._create_export(
new_active_replica, share_server, vserver, vserver_client)
new_active_replica['replica_state'] = constants.REPLICA_STATE_ACTIVE new_active_replica['replica_state'] = constants.REPLICA_STATE_ACTIVE
# 4. Set File system size fixed to false # 4. Set File system size fixed to false

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixed an issue on ONTAP NetApp driver that caused access rules not to be
applied to a promoted replica using CIFS protocol. Please refer to the
`Launchpad bug #1896949 <https://bugs.launchpad.net/manila/+bug/1896949>`_
for more details.