Skip to content

Commit

Permalink
ccloud: fix export locations for CIFS on migration
Browse files Browse the repository at this point in the history
export locations stay the same, look at junction path like NFS
downstream fix for https://bugs.launchpad.net/manila/+bug/1920937

Change-Id: Ia2439b0114ad3bee058fe9b0ee606e41b37a5869
  • Loading branch information
Carthaca committed Mar 25, 2021
1 parent ad9c3c9 commit 0fc3a81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2905,7 +2905,8 @@ def migration_complete(self, context, source_share, destination_share,
# match the name of the share.
export_locations = self._create_export(
destination_share, share_server, vserver, vserver_client,
clear_current_export_policy=False)
clear_current_export_policy=False,
ensure_share_already_exists=True)
src_snaps_dict = {s['id']: s for s in source_snapshots}
snapshot_updates = {}

Expand Down
6 changes: 4 additions & 2 deletions manila/share/drivers/netapp/dataontap/protocols/cifs_cmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ def create_share(self, share, share_name,
if share['share_proto'].lower() != 'multi':
self._client.set_volume_security_style(share_name,
security_style='ntfs')
export_path = self._client.get_volume_junction_path(
share_name, is_style_cifs=True).lstrip("\\")

# Return a callback that may be used for generating export paths
# for this share.
return (lambda export_address, share_name=share_name:
r'\\%s\%s' % (export_address, share_name))
return (lambda export_address, export_path=export_path:
r'\\%s\%s' % (export_address, export_path))

@na_utils.trace
def delete_share(self, share, share_name):
Expand Down

0 comments on commit 0fc3a81

Please sign in to comment.