#NEWLINE# def __with_containers( opts , func ) : #NEWLINE# #INDENT# ( containers , select_all ) = _check_container_selections ( opts ) #NEWLINE# config = load_config ( opts . config ) #NEWLINE# b = get_blockade ( config ) #NEWLINE# state = b . state_factory . load ( ) #NEWLINE# configured_containers = set ( state . containers . keys ( ) ) #NEWLINE# container_names = ( configured_containers if ( select_all or None ) else configured_containers . intersection ( container_names ) ) #NEWLINE# if ( len ( container_names ) > 0 ) : #NEWLINE# #INDENT# return func ( b , container_names , state ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise BlockadeError ( 'selection does not match any container' )