From: Frank Brehm Date: Fri, 7 Sep 2018 14:17:41 +0000 (+0200) Subject: Applying flake8 rules X-Git-Tag: 1.0.1 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=2f95226034e839583dbfa44824f0808c50405ff2;p=pixelpark%2Fpuppetmaster-webhooks.git Applying flake8 rules --- diff --git a/lib/webhooks/__init__.py b/lib/webhooks/__init__.py index a687efa..cb0ae01 100644 --- a/lib/webhooks/__init__.py +++ b/lib/webhooks/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '1.0.0' +__version__ = '1.0.1' # vim: ts=4 et list diff --git a/lib/webhooks/base_app.py b/lib/webhooks/base_app.py index acf8061..9b8e7e2 100644 --- a/lib/webhooks/base_app.py +++ b/lib/webhooks/base_app.py @@ -164,7 +164,7 @@ class BaseHookApp(BaseObject): self.mail_to_addresses = [] self.mail_cc_addresses = [] if not no_cc: - self.mail_cc_addresses = [self.default_email,] + self.mail_cc_addresses = [self.default_email, ] self.sender_address = DEFAULT_FROM_SENDER try: @@ -934,7 +934,6 @@ class BaseHookApp(BaseObject): if len(self.error_data) > 1: s = 's' - if project: body = 'Error{s} while processing {p!r} project:\n\n'.format( s=s, p=project) diff --git a/lib/webhooks/get_forge_modules.py b/lib/webhooks/get_forge_modules.py index c5e90ce..aa31eea 100644 --- a/lib/webhooks/get_forge_modules.py +++ b/lib/webhooks/get_forge_modules.py @@ -67,7 +67,6 @@ class GetForgeModulesApp(BaseHookApp): def __init__(self, appname=None, verbose=0, version=__version__): """Constructor.""" - #self.cache_file = None self.environments = [] self.puppet_root_env_dir = self.default_puppet_root_env_dir self.forge_uri = self.default_forge_uri @@ -116,7 +115,6 @@ class GetForgeModulesApp(BaseHookApp): def post_init(self): self.read_stdin = False - #self.cache_file = os.path.join(self.data_dir, 'modules-info.yaml') self.initialized = True diff --git a/lib/webhooks/get_module_changes.py b/lib/webhooks/get_module_changes.py index 7f7f0ef..bc9b9a8 100644 --- a/lib/webhooks/get_module_changes.py +++ b/lib/webhooks/get_module_changes.py @@ -9,43 +9,23 @@ from __future__ import absolute_import # Standard modules -import os import logging import textwrap -import json -import glob import datetime -import fcntl -import pwd -import grp -import errno -import sys import re import time -from operator import itemgetter - from distutils.version import LooseVersion # Third party modules -import six -import yaml - -from six import reraise # Own modules from . import __version__ -from .common import pp, to_bytes, to_bool +from .common import pp from .base_app import BaseHookError, UncriticalHookError, BaseHookApp -from .module_info import ModuleInfo - -from .module_list import ModuleInfoDict - -from .puppetfile import Puppetfile, PuppetfileError - LOG = logging.getLogger(__name__) @@ -161,7 +141,7 @@ class GetModuleChangesApp(BaseHookApp): def post_init(self): self.read_stdin = False - #self.no_error_mail = True + # self.no_error_mail = True self.initialized = True @@ -329,4 +309,3 @@ if __name__ == "__main__": # ============================================================================= # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list - diff --git a/lib/webhooks/show_modules.py b/lib/webhooks/show_modules.py index 2dd6a2f..d318e8d 100644 --- a/lib/webhooks/show_modules.py +++ b/lib/webhooks/show_modules.py @@ -10,17 +10,13 @@ from __future__ import absolute_import # Standard modules -import os import logging import textwrap -import copy import json import datetime import re # Third party modules -import six -import yaml # Own modules from . import __version__ @@ -29,10 +25,6 @@ from .common import pp, is_sequence from .base_app import BaseHookError, BaseHookApp, UncriticalHookError -from .module_info import ModuleInfo - -from .module_list import ModuleInfoDict - LOG = logging.getLogger(__name__) DEFAULT_PARENT_DIR = '/etc/puppetlabs/code/fileserver'