From 6430709a58a1236fc63c0c55142ad5c2edfc3433 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 20:28:04 +0000 Subject: [PATCH 1/2] Bump pydocstyle from 3.0.0 to 4.0.1 Bumps [pydocstyle](https://github.com/PyCQA/pydocstyle) from 3.0.0 to 4.0.1. - [Release notes](https://github.com/PyCQA/pydocstyle/releases) - [Changelog](https://github.com/PyCQA/pydocstyle/blob/master/docs/release_notes.rst) - [Commits](https://github.com/PyCQA/pydocstyle/compare/3.0.0...4.0.1) Signed-off-by: dependabot-preview[bot] --- requirements/check.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/check.txt b/requirements/check.txt index 25feef312..f453fffab 100644 --- a/requirements/check.txt +++ b/requirements/check.txt @@ -9,7 +9,7 @@ flake8-print==3.1.0 isort==4.3.21 m2r==0.2.1 pep8-naming==0.8.2 -pydocstyle==3.0.0 +pydocstyle==4.0.1 pygments==2.4.2 pylint==2.3.1 readme-renderer==24.0 From 716eaa82d444ed42e92ce7f1cd9a2eac3604d90f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Mon, 19 Aug 2019 16:52:38 -0400 Subject: [PATCH 2/2] Add blank lines for pydocstyle 4 --- src/watchmaker/__init__.py | 2 ++ src/watchmaker/logger/__init__.py | 2 ++ src/watchmaker/managers/platform.py | 2 ++ src/watchmaker/utils/__init__.py | 1 + src/watchmaker/workers/salt.py | 4 ++++ src/watchmaker/workers/yum.py | 1 + tests/test_saltworker.py | 3 +++ 7 files changed, 15 insertions(+) diff --git a/src/watchmaker/__init__.py b/src/watchmaker/__init__.py index 9e97ce945..7c07071f9 100644 --- a/src/watchmaker/__init__.py +++ b/src/watchmaker/__init__.py @@ -163,6 +163,7 @@ class Arguments(dict): # This list would be converted to the following dict and merged # into the parameters passed to the worker configurations: {'arg1': 'value1', 'arg2': 'value2'} + """ def __init__( @@ -203,6 +204,7 @@ class Client(object): Keyword Arguments: arguments: (:obj:`Arguments`) A dictionary of arguments. See :class:`watchmaker.Arguments`. + """ def __init__(self, arguments): diff --git a/src/watchmaker/logger/__init__.py b/src/watchmaker/logger/__init__.py index c936fcf16..fd0e13e8d 100644 --- a/src/watchmaker/logger/__init__.py +++ b/src/watchmaker/logger/__init__.py @@ -84,6 +84,7 @@ def make_log_dir(log_dir): Args: log_dir: (:obj:`str`) Path to a directory. + """ if not os.path.exists(log_dir): os.makedirs(log_dir) @@ -123,6 +124,7 @@ def prepare_logging(log_dir, log_level): - ``warning`` - ``info`` - ``debug`` + """ logformat = ( '%(asctime)s [%(name)s][%(levelname)-5s][%(process)s]: %(message)s' diff --git a/src/watchmaker/managers/platform.py b/src/watchmaker/managers/platform.py index a3588d891..905f77133 100644 --- a/src/watchmaker/managers/platform.py +++ b/src/watchmaker/managers/platform.py @@ -71,6 +71,7 @@ def retrieve_file(self, url, filename): filename: (:obj:`str`) Path where the file will be saved. + """ # Convert a local path to a URI url = watchmaker.utils.uri_from_filepath(url) @@ -268,6 +269,7 @@ def extract_contents(self, filepath, to_directory, create_dir=False): Switch to control the creation of a subdirectory within ``to_directory`` named for the filename of the compressed file. (*Default*: ``False``) + """ if filepath.endswith('.zip'): self.log.debug('File Type: zip') diff --git a/src/watchmaker/utils/__init__.py b/src/watchmaker/utils/__init__.py index e072b9409..6748e3b0b 100644 --- a/src/watchmaker/utils/__init__.py +++ b/src/watchmaker/utils/__init__.py @@ -77,6 +77,7 @@ def copytree(src, dst, force=False, **kwargs): force: (:obj:`bool`) Whether to delete destination prior to copy. (*Default*: ``False``) + """ if force and os.path.exists(dst): shutil.rmtree(dst) diff --git a/src/watchmaker/workers/salt.py b/src/watchmaker/workers/salt.py index a80fbdb1d..52060d2ab 100644 --- a/src/watchmaker/workers/salt.py +++ b/src/watchmaker/workers/salt.py @@ -83,6 +83,7 @@ class SaltBase(WorkerBase, PlatformManagerBase): computer account will be created when joining a domain. E.g. ``"OU=SuperCoolApp,DC=example,DC=com"`` (*Default*: ``''``) + """ def __init__(self, *args, **kwargs): @@ -319,6 +320,7 @@ def run_salt(self, command, **kwargs): Watchmaker will always begin the command with the options ``--local``, ``--retcode-passthrough``, and ``--no-color``, so do not specify those options in the command. + """ cmd = [ self.salt_call, @@ -551,6 +553,7 @@ class SaltLinux(SaltBase, LinuxPlatformManager): A git reference present in ``git_repo``, such as a commit or a tag. If not specified, the HEAD of the default branch is used. (*Default*: ``''``) + """ def __init__(self, *args, **kwargs): @@ -706,6 +709,7 @@ class SaltWindows(SaltBase, WindowsPlatformManager): salt formula. E.g. ``"MemberServer"``, ``"DomainController"``, or ``"Workstation"`` (*Default*: ``''``) + """ def __init__(self, *args, **kwargs): diff --git a/src/watchmaker/workers/yum.py b/src/watchmaker/workers/yum.py index 718632510..c3ae66848 100644 --- a/src/watchmaker/workers/yum.py +++ b/src/watchmaker/workers/yum.py @@ -21,6 +21,7 @@ class Yum(WorkerBase, LinuxPlatformManager): repo_map: (:obj:`list`) List of dictionaries containing a map of yum repo files to systems. (*Default*: ``[]``) + """ SUPPORTED_DISTS = ('amazon', 'centos', 'red hat') diff --git a/tests/test_saltworker.py b/tests/test_saltworker.py index 20164d662..a4841e1b7 100644 --- a/tests/test_saltworker.py +++ b/tests/test_saltworker.py @@ -32,6 +32,7 @@ def test_default_valid_environments(saltworker_client): Args: saltworker_client: (:obj:`src.workers.SaltBase`) + """ # test that the defaults work assert saltworker_client.before_install() is None @@ -43,6 +44,7 @@ def test_bogus_environment(saltworker_client): Args: saltworker_client: (:obj:`src.workers.SaltBase`) + """ # ensure InvalidValue is raised when a bogus environment type is selected with pytest.raises(InvalidValue): @@ -57,6 +59,7 @@ def test_valid_environment(saltworker_client): Args: saltworker_client: (:obj:`src.workers.SaltBase`) + """ saltworker_client.ent_env = 'dev' saltworker_client.valid_envs = [None, 'dev', 'test', 'prod']