diff options
Diffstat (limited to 'plugins/modules/vyos_config.py')
-rw-r--r-- | plugins/modules/vyos_config.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index 4b2b31d..2a03d0c 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" |