From 8ee9e8b5ff731fd5a4ff9c44fa6034b7d3a0a2a5 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 12 Aug 2021 08:53:21 +0200 Subject: [PATCH] Fix sanity failures (#43) * Fix sanity failures. * Add changelog fragment. (cherry picked from commit a88f4c804b147136f9164e571408e90a649532e1) --- changelogs/fragments/43-sanity.yml | 2 ++ plugins/cliconf/routeros.py | 2 +- tests/unit/plugins/modules/test_facts.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/43-sanity.yml diff --git a/changelogs/fragments/43-sanity.yml b/changelogs/fragments/43-sanity.yml new file mode 100644 index 0000000..5c918d1 --- /dev/null +++ b/changelogs/fragments/43-sanity.yml @@ -0,0 +1,2 @@ +bugfixes: +- "routeros cliconf plugin - adjust function signature that was modified in Ansible after creation of this plugin (https://github.com/ansible-collections/community.routeros/pull/43)." diff --git a/plugins/cliconf/routeros.py b/plugins/cliconf/routeros.py index 6c49373..f46b3a0 100644 --- a/plugins/cliconf/routeros.py +++ b/plugins/cliconf/routeros.py @@ -65,7 +65,7 @@ class Cliconf(CliconfBase): return device_info - def get_config(self, source='running', format='text', flags=None): + def get_config(self, source='running', flags=None, format=None): return def edit_config(self, command): diff --git a/tests/unit/plugins/modules/test_facts.py b/tests/unit/plugins/modules/test_facts.py index ea111df..9552047 100644 --- a/tests/unit/plugins/modules/test_facts.py +++ b/tests/unit/plugins/modules/test_facts.py @@ -43,7 +43,7 @@ class TestRouterosFactsModule(TestRouterosModule): output = list() for command in commands: - filename = str(command).split(' | ')[0].replace(' ', '_') + filename = str(command).split(' | ', 1)[0].replace(' ', '_') output.append(load_fixture('facts%s' % filename)) return output