From 8323f3e3b7964fc78b7358a71462340e5f17ff50 Mon Sep 17 00:00:00 2001 From: Artem Leshchev Date: Mon, 20 Aug 2018 07:49:16 +0300 Subject: [PATCH] Fix module name in error text at parse_xml filter (#44313) * Fix module name in error text at parse_xml filter * Fix test that includes erroneous module name in error text at parse_xml filter --- lib/ansible/plugins/filter/network.py | 2 +- test/units/plugins/filter/test_network.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/filter/network.py b/lib/ansible/plugins/filter/network.py index 585f2d2d2c..ef373ebb7d 100644 --- a/lib/ansible/plugins/filter/network.py +++ b/lib/ansible/plugins/filter/network.py @@ -324,7 +324,7 @@ def _extract_param(template, root, attrs, value): def parse_xml(output, tmpl): if not os.path.exists(tmpl): - raise AnsibleError('unable to locate parse_cli template: %s' % tmpl) + raise AnsibleError('unable to locate parse_xml template: %s' % tmpl) if not isinstance(output, string_types): raise AnsibleError('parse_xml works on string input, but given input of : %s' % type(output)) diff --git a/test/units/plugins/filter/test_network.py b/test/units/plugins/filter/test_network.py index 71073d7e97..d1f4b49282 100644 --- a/test/units/plugins/filter/test_network.py +++ b/test/units/plugins/filter/test_network.py @@ -76,7 +76,7 @@ class TestNetworkParseFilter(unittest.TestCase): with self.assertRaises(Exception) as e: parse_xml(output_xml, 'junk_path') - self.assertEqual("unable to locate parse_cli template: junk_path", str(e.exception)) + self.assertEqual("unable to locate parse_xml template: junk_path", str(e.exception)) with self.assertRaises(Exception) as e: parse_xml(output, spec_file_path)