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
pull/44376/head
Artem Leshchev 6 years ago committed by Ganesh Nalawade
parent e6f0f8073d
commit 8323f3e3b7

@ -324,7 +324,7 @@ def _extract_param(template, root, attrs, value):
def parse_xml(output, tmpl): def parse_xml(output, tmpl):
if not os.path.exists(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): if not isinstance(output, string_types):
raise AnsibleError('parse_xml works on string input, but given input of : %s' % type(output)) raise AnsibleError('parse_xml works on string input, but given input of : %s' % type(output))

@ -76,7 +76,7 @@ class TestNetworkParseFilter(unittest.TestCase):
with self.assertRaises(Exception) as e: with self.assertRaises(Exception) as e:
parse_xml(output_xml, 'junk_path') 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: with self.assertRaises(Exception) as e:
parse_xml(output, spec_file_path) parse_xml(output, spec_file_path)

Loading…
Cancel
Save