#NEWLINE# def _list_iter( host = None , path = None ) : #NEWLINE# #INDENT# '\n    Return a generator iterating over hosts\n\n    path\n        path to the container parent\n        default: /var/lib/lxc (system default)\n\n        .. versionadded:: 2015.8.0\n    ' #NEWLINE# tgt = ( host or '*' ) #NEWLINE# client = salt . client . get_local_client ( __opts__ [ 'conf_file' ] ) #NEWLINE# for container_info in client . cmd_iter ( tgt , 'lxc.list' , kwarg = { #NEWLINE# #INDENT# 'path' : path , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# if ( not container_info ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not isinstance ( container_info , dict ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# chunk = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# id_ = next ( six . iterkeys ( container_info ) ) #NEWLINE# if ( host and ( host != id_ ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not isinstance ( container_info [ id_ ] , dict ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( 'ret' not in container_info [ id_ ] ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not isinstance ( container_info [ id_ ] [ 'ret' ] , dict ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# chunk [ id_ ] = container_info [ id_ ] [ 'ret' ] #NEWLINE# ( yield chunk )