def file_list(saltenv='base', backend=None): ''' Return a list of files from the salt fileserver saltenv : base The salt fileserver environment to be listed backend Narrow fileserver backends to a subset of the enabled ones. If all passed backends start with a minus sign (``-``), then these backends will be excluded from the enabled backends. However, if there is a mix of backends with and without a minus sign (ex: ``backend=-roots,git``) then the ones starting with a minus sign will be disregarded. .. versionadded:: 2015.5.0 CLI Examples: .. code-block:: bash salt-run fileserver.file_list salt-run fileserver.file_list saltenv=prod salt-run fileserver.file_list saltenv=dev backend=git salt-run fileserver.file_list base hg,roots salt-run fileserver.file_list -git ''' fileserver = salt.fileserver.Fileserver(__opts__) load = {'saltenv': saltenv, 'fsbackend': backend} return fileserver.file_list(load=load)
def file_list(saltenv='base', outputter='nested'): ''' Return a list of files from the dominant environment CLI Example: .. code-block:: bash salt-run fileserver.file_list salt-run fileserver.file_list saltenv=prod ''' fileserver = salt.fileserver.Fileserver(__opts__) load = {'saltenv': saltenv} output = fileserver.file_list(load=load) if outputter: salt.output.display_output(output, outputter, opts=__opts__) return output
def file_list(saltenv="base", backend=None): """ Return a list of files from the salt fileserver saltenv : base The salt fileserver environment to be listed backend Narrow fileserver backends to a subset of the enabled ones. If all passed backends start with a minus sign (``-``), then these backends will be excluded from the enabled backends. However, if there is a mix of backends with and without a minus sign (ex: ``backend=-roots,git``) then the ones starting with a minus sign will be disregarded. .. versionadded:: 2015.5.0 .. note: Keep in mind that executing this function spawns a new process, separate from the master. This means that if the fileserver configuration has been changed in some way since the master has been restarted (e.g. if :conf_master:`fileserver_backend`, :conf_master:`gitfs_remotes`, :conf_master:`hgfs_remotes`, etc. have been updated), then the results of this runner will not accurately reflect what files are available to minions. When in doubt, use :py:func:`cp.list_master <salt.modules.cp.list_master>` to see what files the minion can see, and always remember to restart the salt-master daemon when updating the fileserver configuration. CLI Examples: .. code-block:: bash salt-run fileserver.file_list salt-run fileserver.file_list saltenv=prod salt-run fileserver.file_list saltenv=dev backend=git salt-run fileserver.file_list base hg,roots salt-run fileserver.file_list -git """ fileserver = salt.fileserver.Fileserver(__opts__) load = {"saltenv": saltenv, "fsbackend": backend} return fileserver.file_list(load=load)
def file_list(saltenv='base', outputter='nested'): ''' Return a list of files from the dominant environment CLI Example: .. code-block:: bash salt-run fileserver.file_list salt-run fileserver.file_list saltenv=prod ''' fileserver = salt.fileserver.Fileserver(__opts__) load = {'saltenv': saltenv} output = fileserver.file_list(load=load) if outputter: return {'outputter': outputter, 'data': output} else: return output
def file_list(saltenv='base', backend=None, outputter=None): ''' Return a list of files from the salt fileserver saltenv : base The salt fileserver environment to be listed backend Narrow fileserver backends to a subset of the enabled ones. If all passed backends start with a minus sign (``-``), then these backends will be excluded from the enabled backends. However, if there is a mix of backends with and without a minus sign (ex: ``backend=-roots,git``) then the ones starting with a minus sign will be disregarded. .. versionadded:: 2015.5.0 CLI Examples: .. code-block:: bash salt-run fileserver.file_list salt-run fileserver.file_list saltenv=prod salt-run fileserver.file_list saltenv=dev backend=git salt-run fileserver.file_list base hg,roots salt-run fileserver.file_list -git ''' fileserver = salt.fileserver.Fileserver(__opts__) load = {'saltenv': saltenv, 'fsbackend': backend} output = fileserver.file_list(load=load) if outputter: salt.utils.warn_until( 'Boron', 'The \'outputter\' argument to the fileserver.file_list runner ' 'has been deprecated. Please specify an outputter using --out. ' 'See the output of \'salt-run -h\' for more information.' ) return {'outputter': outputter, 'data': output} else: return output