Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saltstack:salt execution module junos.rpc get-config invalid filter throws SyntaxError exception #90

Closed
rsmekala opened this issue Apr 3, 2019 · 1 comment

Comments

@rsmekala
Copy link

rsmekala commented Apr 3, 2019

Description of Issue/Question

No exception handling is implemented around XML parsing.

Logs:

➜ salt 'vmx' junos.rpc get-config format=xml dest=/tmp/cli.out filter='<configuration>' 

vmx:
    The minion function caused an exception: Traceback (most recent call last):
      File "/Users/rsmekala/PycharmProjects/salt/salt/minion.py", line 1660, in _thread_return
        return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
      File "/Users/rsmekala/PycharmProjects/salt/salt/executors/direct_call.py", line 12, in execute
        return func(*args, **kwargs)
      File "/Users/rsmekala/PycharmProjects/salt/salt/modules/junos.py", line 89, in wrapper
        conn.timeout = kwargs.pop('dev_timeout', None)
      File "/Users/rsmekala/PycharmProjects/salt/salt/modules/junos.py", line 215, in rpc
        else:
      File "src/lxml/etree.pyx", line 3190, in lxml.etree.XML
      File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument
      File "src/lxml/parser.pxi", line 1758, in lxml.etree._parseDoc
      File "src/lxml/parser.pxi", line 1068, in lxml.etree._BaseParser._parseUnicodeDoc
      File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
      File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
      File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError
      File "<string>", line 1
    lxml.etree.XMLSyntaxError: Premature end of data in tag configuration line 1, line 1, column 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant