Merge "Pure: Ensure generated volume name does not exceed 63 characters"

This commit is contained in:
Zuul 2019-10-14 20:56:51 +00:00 committed by Gerrit Code Review
commit 32ee0f06e6

View File

@ -1547,6 +1547,15 @@ class PureBaseVolumeDriver(san.SanDriver):
"""
base_name = volume.name
# Some OpenStack deployments, eg PowerVC, create a volume.name that
# when appended with out '-cinder' string will exceed the maximum
# volume name length for Pure, so here we left truncate the true volume
# name before the opennstack volume_name_template affected it and
# then put back the template format
if len(base_name) > 56:
actual_name = base_name[7:]
base_name = "volume-" + actual_name[-52:]
repl_type = self._get_replication_type_from_vol_type(
volume.volume_type)
if repl_type == REPLICATION_TYPE_SYNC: