'Gets the extra specs associated with a volume type.
:param volume: the volume dictionary
:param volume_type_id: Optional override for volume.volume_type_id
:returns: dict -- extra_specs - the extra specs
:raises: VolumeBackendAPIException'

@staticmethod
def get_volumetype_extra_specs(volume, volume_type_id=None):

    extra_specs = {}
    try:
        if volume_type_id:
            type_id = volume_type_id
        else:
            type_id = volume.volume_type_id
        if (type_id is not None):
            extra_specs = volume_types.get_volume_type_extra_specs(type_id)
    except Exception as e:
        LOG.debug('Exception    getting    volume    type    extra    specs:    %(e)s', {'e': six.text_type(e)})
    return extra_specs
