summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/fragments/fix_pylint_issues.yaml3
-rw-r--r--plugins/cliconf/vyos.py2
-rw-r--r--tests/sanity/ignore-2.12.txt2
-rw-r--r--tests/unit/mock/loader.py8
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_interface.py2
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_ping.py2
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_static_route.py2
-rw-r--r--tests/unit/modules/network/vyos/test_vyos_user.py2
8 files changed, 13 insertions, 10 deletions
diff --git a/changelogs/fragments/fix_pylint_issues.yaml b/changelogs/fragments/fix_pylint_issues.yaml
new file mode 100644
index 0000000..6e278f6
--- /dev/null
+++ b/changelogs/fragments/fix_pylint_issues.yaml
@@ -0,0 +1,3 @@
+---
+trivial:
+ - Fix pylint failures seen in sanity tests.
diff --git a/plugins/cliconf/vyos.py b/plugins/cliconf/vyos.py
index d63c677..339aed9 100644
--- a/plugins/cliconf/vyos.py
+++ b/plugins/cliconf/vyos.py
@@ -174,8 +174,8 @@ class Cliconf(CliconfBase):
prompt=None,
answer=None,
sendonly=False,
- output=None,
newline=True,
+ output=None,
check_all=False,
):
if not command:
diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt
index d753480..496cf86 100644
--- a/tests/sanity/ignore-2.12.txt
+++ b/tests/sanity/ignore-2.12.txt
@@ -9,4 +9,4 @@ plugins/module_utils/network/vyos/config/prefix_lists/prefix_lists.py import-2.6
plugins/module_utils/network/vyos/config/prefix_lists/prefix_lists.py compile-2.6!skip
plugins/modules/vyos_logging_global.py import-2.6!skip
plugins/module_utils/network/vyos/config/logging_global/logging_global.py import-2.6!skip
-plugins/module_utils/network/vyos/config/logging_global/logging_global.py compile-2.6!skip \ No newline at end of file
+plugins/module_utils/network/vyos/config/logging_global/logging_global.py compile-2.6!skip
diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py
index c21188e..aea5df5 100644
--- a/tests/unit/mock/loader.py
+++ b/tests/unit/mock/loader.py
@@ -46,12 +46,12 @@ class DictDataLoader(DataLoader):
# TODO: the real _get_file_contents returns a bytestring, so we actually convert the
# unicode/text it's created with to utf-8
- def _get_file_contents(self, path):
- path = to_text(path)
+ def _get_file_contents(self, file_name):
+ path = to_text(file_name)
if path in self._file_mapping:
- return (to_bytes(self._file_mapping[path]), False)
+ return (to_bytes(self._file_mapping[file_name]), False)
else:
- raise AnsibleParserError("file not found: %s" % path)
+ raise AnsibleParserError("file not found: %s" % file_name)
def path_exists(self, path):
path = to_text(path)
diff --git a/tests/unit/modules/network/vyos/test_vyos_interface.py b/tests/unit/modules/network/vyos/test_vyos_interface.py
index 1194e3b..e0e4bfc 100644
--- a/tests/unit/modules/network/vyos/test_vyos_interface.py
+++ b/tests/unit/modules/network/vyos/test_vyos_interface.py
@@ -86,7 +86,7 @@ class TestVyosInterfaceModule(TestVyosModule):
self.mock_execute_lldp_command.stop()
self.mock_execute_interfaces_command.stop()
- def load_fixtures(self, commands=None, transport="cli"):
+ def load_fixtures(self, commands=None, transport="cli", filename=None):
self.get_config.return_value = load_fixture(
"vyos_interface_config.cfg"
)
diff --git a/tests/unit/modules/network/vyos/test_vyos_ping.py b/tests/unit/modules/network/vyos/test_vyos_ping.py
index f3ba2ee..60407ad 100644
--- a/tests/unit/modules/network/vyos/test_vyos_ping.py
+++ b/tests/unit/modules/network/vyos/test_vyos_ping.py
@@ -49,7 +49,7 @@ class TestVyosPingModule(TestVyosModule):
output = list()
for command in commands:
- filename = str(command).split(" | ")[0].replace(" ", "_")
+ filename = str(command).split(" | ", 1)[0].replace(" ", "_")
output.append(load_fixture("vyos_ping_%s" % filename))
return output
diff --git a/tests/unit/modules/network/vyos/test_vyos_static_route.py b/tests/unit/modules/network/vyos/test_vyos_static_route.py
index 21f1139..00985c6 100644
--- a/tests/unit/modules/network/vyos/test_vyos_static_route.py
+++ b/tests/unit/modules/network/vyos/test_vyos_static_route.py
@@ -52,7 +52,7 @@ class TestVyosStaticRouteModule(TestVyosModule):
self.mock_get_config.stop()
self.mock_load_config.stop()
- def load_fixtures(self, commands=None, transport="cli"):
+ def load_fixtures(self, commands=None, transport="cli", filename=None):
self.get_config.return_value = ""
self.load_config.return_value = dict(diff=None, session="session")
diff --git a/tests/unit/modules/network/vyos/test_vyos_user.py b/tests/unit/modules/network/vyos/test_vyos_user.py
index d4c2dbe..616ad09 100644
--- a/tests/unit/modules/network/vyos/test_vyos_user.py
+++ b/tests/unit/modules/network/vyos/test_vyos_user.py
@@ -50,7 +50,7 @@ class TestVyosUserModule(TestVyosModule):
self.mock_get_config.stop()
self.mock_load_config.stop()
- def load_fixtures(self, commands=None, transport="cli"):
+ def load_fixtures(self, commands=None, transport="cli", filename=None):
self.get_config.return_value = load_fixture("vyos_user_config.cfg")
self.load_config.return_value = dict(diff=None, session="session")