summaryrefslogtreecommitdiff
path: root/plugins/module_utils/network/vyos/facts/lldp_global
diff options
context:
space:
mode:
authorKate Case <kcase@redhat.com>2023-01-25 08:37:58 -0500
committerGitHub <noreply@github.com>2023-01-25 08:37:58 -0500
commite9911888f6dcdf9031f3fdb2e32c52e45815fdbe (patch)
treedc22abb4a329ef04e98685b81d074679dc24c456 /plugins/module_utils/network/vyos/facts/lldp_global
parentbcfe61a3b6ff69f08450f3dbd8f0f1827fb18ab3 (diff)
downloadvyos-ansible-collection-e9911888f6dcdf9031f3fdb2e32c52e45815fdbe.tar.gz
vyos-ansible-collection-e9911888f6dcdf9031f3fdb2e32c52e45815fdbe.zip
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>
Diffstat (limited to 'plugins/module_utils/network/vyos/facts/lldp_global')
-rw-r--r--plugins/module_utils/network/vyos/facts/lldp_global/lldp_global.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/module_utils/network/vyos/facts/lldp_global/lldp_global.py b/plugins/module_utils/network/vyos/facts/lldp_global/lldp_global.py
index 22b6bc8..e563999 100644
--- a/plugins/module_utils/network/vyos/facts/lldp_global/lldp_global.py
+++ b/plugins/module_utils/network/vyos/facts/lldp_global/lldp_global.py
@@ -13,12 +13,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
-from re import findall, M
from copy import deepcopy
+from re import M, findall
+
+from ansible_collections.ansible.netcommon.plugins.module_utils.network.common import utils
-from ansible_collections.ansible.netcommon.plugins.module_utils.network.common import (
- utils,
-)
from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.argspec.lldp_global.lldp_global import (
Lldp_globalArgs,
)
@@ -84,12 +83,8 @@ class Lldp_globalFacts(object):
:rtype: dictionary
:returns: The generated config
"""
- protocol_conf = "\n".join(
- filter(lambda x: ("legacy-protocols" in x), conf)
- )
- att_conf = "\n".join(
- filter(lambda x: ("legacy-protocols" not in x), conf)
- )
+ protocol_conf = "\n".join(filter(lambda x: ("legacy-protocols" in x), conf))
+ att_conf = "\n".join(filter(lambda x: ("legacy-protocols" not in x), conf))
config = self.parse_attribs(["snmp", "address"], att_conf)
config["legacy_protocols"] = self.parse_protocols(protocol_conf)
return utils.remove_empties(config)