def get_associations(context, qos_specs_id):
 try:
  types = objects.VolumeTypeList.get_all_types_for_qos(context, qos_specs_id)
 except db_exc.DBError:
  LOG.exception(_LE('DB error:'))
  msg = (_('Failed to get all associations of qos specs %s') % qos_specs_id)
  LOG.warning(msg)
  raise exception.CinderException(message=msg)
 result = []
 for vol_type in types:
  result.append({'association_type': 'volume_type', 'name': vol_type.name, 'id': vol_type.id})
 return result

def get_associations ( context , qos_specs_id ) : try : types = objects . VolumeTypeList . get_all_types_for_qos ( context , qos_specs_id ) except db_exc . DBError : LOG . exception ( _LE ( 'DB error:' ) ) msg = ( _ ( 'Failed to get all associations of qos specs %s' ) % qos_specs_id ) LOG . warning ( msg ) raise exception . CinderException ( message = msg ) result = [ ] for vol_type in types : result . append ( { 'association_type' : 'volume_type' , 'name' : vol_type . name , 'id' : vol_type . id } ) return result
get all associations of given qos specs .