From e9911888f6dcdf9031f3fdb2e32c52e45815fdbe Mon Sep 17 00:00:00 2001 From: Kate Case Date: Wed, 25 Jan 2023 08:37:58 -0500 Subject: Add prettier and isort to pre-commit. (#270) * Add prettier and isort to pre-commit. * Bump line-length to 100 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- plugins/modules/vyos_config.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'plugins/modules/vyos_config.py') diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index 4b2b31d9..2a03d0c3 100644 --- a/plugins/modules/vyos_config.py +++ b/plugins/modules/vyos_config.py @@ -197,21 +197,17 @@ import re from ansible.module_utils._text import to_text from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.connection import ConnectionError + from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - load_config, get_config, - run_commands, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( get_connection, + load_config, + run_commands, ) - DEFAULT_COMMENT = "configured by vyos_config" -CONFIG_FILTERS = [ - re.compile(r"set system login user \S+ authentication encrypted-password") -] +CONFIG_FILTERS = [re.compile(r"set system login user \S+ authentication encrypted-password")] def get_candidate(module): @@ -316,8 +312,7 @@ def run(module, result): if result.get("filtered"): result["warnings"].append( - "Some configuration commands were " - "removed, please see the filtered key" + "Some configuration commands were removed, please see the filtered key" ) result["changed"] = True @@ -365,9 +360,7 @@ def main(): result["changed"] = True run_commands(module, commands=["exit"]) - if result.get("changed") and any( - (module.params["src"], module.params["lines"]) - ): + if result.get("changed") and any((module.params["src"], module.params["lines"])): msg = ( "To ensure idempotency and correct diff the input configuration lines should be" " similar to how they appear if present in" -- cgit v1.2.3