@require_admin_context
def volume_get_all_by_host(context, host, filters=None):
 if (host and isinstance(host, six.string_types)):
  session = get_session()
  with session.begin():
   host_attr = getattr(models.Volume, 'host')
   conditions = [(host_attr == host), host_attr.op('LIKE')((host + '#%'))]
   query = _volume_get_query(context).filter(or_(*conditions))
   if filters:
    query = _process_volume_filters(query, filters)
    if (query is None):
     return []
   return query.all()
 elif (not host):
  return []

@ require_admin_context def volume_get_all_by_host ( context , host , filters = None ) : if ( host and isinstance ( host , six . string_types ) ) : session = get_session ( ) with session . begin ( ) : host_attr = getattr ( models . Volume , 'host' ) conditions = [ ( host_attr == host ) , host_attr . op ( 'LIKE' ) ( ( host + '#%' ) ) ] query = _volume_get_query ( context ) . filter ( or_ ( * conditions ) ) if filters : query = _process_volume_filters ( query , filters ) if ( query is None ) : return [ ] return query . all ( ) elif ( not host ) : return [ ]
get all volumes belonging to a host .