cifs_cmode.py (manila-8.1.3) | : | cifs_cmode.py (manila-8.1.4) | ||
---|---|---|---|---|
skipping to change at line 165 | skipping to change at line 165 | |||
@staticmethod | @staticmethod | |||
def _get_export_location(share): | def _get_export_location(share): | |||
"""Returns host ip and share name for a given CIFS share.""" | """Returns host ip and share name for a given CIFS share.""" | |||
export_location = share['export_location'] or '\\\\\\' | export_location = share['export_location'] or '\\\\\\' | |||
regex = r'^(?:\\\\|//)(?P<host_ip>.*)(?:\\|/)(?P<share_name>.*)$' | regex = r'^(?:\\\\|//)(?P<host_ip>.*)(?:\\|/)(?P<share_name>.*)$' | |||
match = re.match(regex, export_location) | match = re.match(regex, export_location) | |||
if match: | if match: | |||
return match.group('host_ip'), match.group('share_name') | return match.group('host_ip'), match.group('share_name') | |||
else: | else: | |||
return '', '' | return '', '' | |||
@na_utils.trace | ||||
def cleanup_demoted_replica(self, share, share_name): | ||||
"""Cleans up some things regarding a demoted replica.""" | ||||
# NOTE(carloss): This is necessary due to bug 1879368. If we do not | ||||
# remove this CIFS share, in case the demoted replica is promoted | ||||
# back, the promotion will fail due to a duplicated entry for the | ||||
# share, since a create share request is sent to the backend every | ||||
# time a promotion occurs. | ||||
self._client.remove_cifs_share(share_name) | ||||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added |