Fixup a few merge conflict problems & pylint

This commit is contained in:
C. R. Oldham 2015-02-27 15:26:51 -07:00
parent c9610bc4f2
commit 3034c343ba
4 changed files with 7 additions and 105 deletions

View File

@ -16,6 +16,8 @@ import time
import salt.loader
import salt.utils
from salt.ext.six import string_types
import salt.ext.six as six
log = logging.getLogger(__name__)

View File

@ -48,6 +48,9 @@ import salt.utils.verify
import salt.utils.minions
import salt.utils.gzip_util
import salt.utils.process
import salt.utils.zeromq
import salt.utils.jid
from salt.defaults import DEFAULT_TARGET_DELIM
from salt.exceptions import FileserverConfigError
from salt.utils.debug import enable_sigusr1_handler, enable_sigusr2_handler, inspect_stack
from salt.utils.event import tagify

View File

@ -18,10 +18,12 @@ from __future__ import absolute_import
# Import python libs
import logging
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module
import json
# Import salt libs
from salt.ext.six import string_types
# Import third party libs
try:
import pymongo

View File

@ -118,111 +118,6 @@ def symlink_list(saltenv='base', backend=None, outputter='nested'):
return output
def dir_list(saltenv='base', backend=None, outputter='nested'):
'''
Return a list of directories in the given environment
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.2.0
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.2.0
CLI Examples:
.. code-block:: bash
salt-run fileserver.dir_list
salt-run fileserver.dir_list saltenv=prod
salt-run fileserver.dir_list saltenv=dev backend=git
salt-run fileserver.dir_list base hg,roots
salt-run fileserver.dir_list -git
'''
fileserver = salt.fileserver.Fileserver(__opts__)
load = {'saltenv': saltenv, 'fsbackend': backend}
output = fileserver.dir_list(load=load)
if outputter:
return {'outputter': outputter, 'data': output}
else:
return output
def empty_dir_list(saltenv='base', backend=None, outputter='nested'):
'''
.. versionadded:: 2015.2.0
Return a list of empty directories in the given environment
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.
.. note::
Some backends (such as :mod:`git <salt.fileserver.gitfs>` and
:mod:`hg <salt.fileserver.hgfs>`) do not support empty directories.
So, passing ``backend=git`` or ``backend=hg`` will result in an
empty list being returned.
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.2.0
CLI Example:
.. code-block:: bash
salt-run fileserver.empty_dir_list
salt-run fileserver.empty_dir_list saltenv=prod
salt-run fileserver.empty_dir_list backend=roots
'''
fileserver = salt.fileserver.Fileserver(__opts__)
load = {'saltenv': saltenv, 'fsbackend': backend}
output = fileserver.file_list_emptydirs(load=load)
if outputter:
return {'outputter': outputter, 'data': output}
else:
return output
def dir_list(saltenv='base', backend=None, outputter='nested'):
'''
Return a list of directories in the given environment