def _get_volume_type_extra_spec(type_id, spec_key, possible_values=None, default_value=None):
 if (not type_id):
  return default_value
 spec_key = ('vmware:%s' % spec_key)
 spec_value = volume_types.get_volume_type_extra_specs(type_id, spec_key)
 if (not spec_value):
  LOG.debug('Returning default spec value: %s.', default_value)
  return default_value
 if (possible_values is None):
  return spec_value
 if (spec_value in possible_values):
  LOG.debug('Returning spec value %s', spec_value)
  return spec_value
 LOG.debug('Invalid spec value: %s specified.', spec_value)

def _get_volume_type_extra_spec ( type_id , spec_key , possible_values = None , default_value = None ) : if ( not type_id ) : return default_value spec_key = ( 'vmware:%s' % spec_key ) spec_value = volume_types . get_volume_type_extra_specs ( type_id , spec_key ) if ( not spec_value ) : LOG . debug ( 'Returning default spec value: %s.' , default_value ) return default_value if ( possible_values is None ) : return spec_value if ( spec_value in possible_values ) : LOG . debug ( 'Returning spec value %s' , spec_value ) return spec_value LOG . debug ( 'Invalid spec value: %s specified.' , spec_value )
get extra spec value .