I notice that my _get_volume_type volume creation flow code is different from the one in master[1]:
==================== def _get_volume_type(self, context, volume_type, source_volume, snapshot, image_volume_type_id): if volume_type: return volume_type identifier = collections.defaultdict(str) try: if source_volume: identifier = {'source': 'volume', 'id': source_volume['volume_type_id']} elif snapshot: identifier = {'source': 'snapshot', 'id': snapshot['volume_type_id']} elif image_volume_type_id: identifier = {'source': 'image', 'id': image_volume_type_id} elif CONF.default_volume_type: identifier = {'source': 'default volume type config', 'id': CONF.default_volume_type} if identifier: return objects.VolumeType.get_by_name_or_id( context, identifier['id']) except (exception.VolumeTypeNotFound, exception.VolumeTypeNotFoundByName, exception.InvalidVolumeType): LOG.exception("Failed to find volume type from " "source %(source)s, identifier %(id)s", identifier) return None ====================
[1] https://github.com/openstack/cinder/blob/master/cinder/volume/flows/api/create_volume.py#L352
I notice that my _get_volume_type volume creation flow code is different from the one in master[1]:
======= ======= ====== type(self, context, volume_type,
source_ volume, snapshot, image_volume_ type_id) : defaultdict( str)
identifier = {'source': 'volume',
'id': source_ volume[ 'volume_ type_id' ]}
identifier = {'source': 'snapshot',
'id': snapshot[ 'volume_ type_id' ]} type_id:
identifier = {'source': 'image',
'id': image_volume_ type_id} volume_ type:
identifier = {'source': 'default volume type config',
'id': CONF.default_ volume_ type}
return objects. VolumeType. get_by_ name_or_ id(
context, identifier['id']) VolumeTypeNotFo und,
exception. VolumeTypeNotFo undByName,
exception. InvalidVolumeTy pe):
LOG. exception( "Failed to find volume type from "
"source %(source)s, identifier %(id)s", identifier) ======= ======
def _get_volume_
if volume_type:
return volume_type
identifier = collections.
try:
if source_volume:
elif snapshot:
elif image_volume_
elif CONF.default_
if identifier:
except (exception.
return None
=======
[1] https:/ /github. com/openstack/ cinder/ blob/master/ cinder/ volume/ flows/api/ create_ volume. py#L352