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