コード例 #1
0
ファイル: fileserver.py プロジェクト: xofyarg/salt
def symlink_list(saltenv='base', backend=None):
    '''
    Return a list of symlinked files and dirs

    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 Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
        salt-run fileserver.symlink_list saltenv=dev backend=git
        salt-run fileserver.symlink_list base hg,roots
        salt-run fileserver.symlink_list -git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    return fileserver.symlink_list(load=load)
コード例 #2
0
ファイル: fileserver.py プロジェクト: bryson/salt
def symlink_list(saltenv='base', backend=None):
    '''
    Return a list of symlinked files and dirs

    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 Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
        salt-run fileserver.symlink_list saltenv=dev backend=git
        salt-run fileserver.symlink_list base hg,roots
        salt-run fileserver.symlink_list -git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    return fileserver.symlink_list(load=load)
コード例 #3
0
ファイル: fileserver.py プロジェクト: yeyuexia/salt
def symlink_list(saltenv='base', outputter='nested'):
    '''
    Return a list of symlinked files and dirs

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv}
    output = fileserver.symlink_list(load=load)

    if outputter:
        salt.output.display_output(output, outputter, opts=__opts__)
    return output
コード例 #4
0
def symlink_list(saltenv="base", backend=None):
    """
    Return a list of symlinked files and dirs

    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 symlinks are available to minions.

        When in doubt, use :py:func:`cp.list_master_symlinks
        <salt.modules.cp.list_master_symlinks>` to see what symlinks the minion
        can see, and always remember to restart the salt-master daemon when
        updating the fileserver configuration.

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
        salt-run fileserver.symlink_list saltenv=dev backend=git
        salt-run fileserver.symlink_list base hg,roots
        salt-run fileserver.symlink_list -git
    """
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {"saltenv": saltenv, "fsbackend": backend}
    return fileserver.symlink_list(load=load)
コード例 #5
0
ファイル: fileserver.py プロジェクト: virHappy/salt
def symlink_list(saltenv='base', outputter='nested'):
    '''
    Return a list of symlinked files and dirs

    CLI Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv}
    output = fileserver.symlink_list(load=load)

    if outputter:
        return {'outputter': outputter, 'data': output}
    else:
        return output
コード例 #6
0
ファイル: fileserver.py プロジェクト: randybias/salt
def symlink_list(saltenv='base', backend=None, outputter=None):
    '''
    Return a list of symlinked files and dirs

    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 Example:

    .. code-block:: bash

        salt-run fileserver.symlink_list
        salt-run fileserver.symlink_list saltenv=prod
        salt-run fileserver.symlink_list saltenv=dev backend=git
        salt-run fileserver.symlink_list base hg,roots
        salt-run fileserver.symlink_list -git
    '''
    fileserver = salt.fileserver.Fileserver(__opts__)
    load = {'saltenv': saltenv, 'fsbackend': backend}
    output = fileserver.symlink_list(load=load)

    if outputter:
        salt.utils.warn_until(
            'Boron',
            'The \'outputter\' argument to the fileserver.symlink_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