Merge "Make sure to set default_volume_type when only one storage backend"

This commit is contained in:
Zuul 2019-08-09 15:43:49 +00:00 committed by Gerrit Code Review
commit bcdef4e424
1 changed files with 12 additions and 11 deletions

View File

@ -103,17 +103,18 @@ class CinderHelm(openstack.OpenstackBaseHelm):
},
}
# If there are more CEPH backends, we default to the volume type
# associated with the primary CEPH tier, which currently has the name
# set to 'ceph-store'.
if len(backends) > 1:
default = next(
(b.name for b in backends
if b.name ==
constants.SB_DEFAULT_NAMES[constants.SB_TYPE_CEPH]), None)
if default:
conf_cinder['DEFAULT']['default_volume_type'] = \
default.encode('utf8', 'strict')
# Always set the default_volume_type to the volume type associated with the
# primary Ceph backend/tier which is available on all StarlingX platform
# configurations. This will guarantee that any Cinder API requests for
# this value will be fulfilled as part of determining a safe volume type to
# use during volume creation. This can be overrides by the user when/if
# additional backends are added to the platform.
default = next(
(b.name for b in backends
if b.name == constants.SB_DEFAULT_NAMES[constants.SB_TYPE_CEPH]), None)
if default:
conf_cinder['DEFAULT']['default_volume_type'] = \
default.encode('utf8', 'strict')
return conf_cinder