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

Junos Translate/RPC Exception #25

Open
rickdonato opened this issue Sep 3, 2019 · 0 comments
Open

Junos Translate/RPC Exception #25

rickdonato opened this issue Sep 3, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@rickdonato
Copy link

rickdonato commented Sep 3, 2019

After translating a Yang model to native config, and then sending the config to a vQFX via Napalm I get the following,

Traceback (most recent call last):
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/utils/config.py", line 456, in try_load
    **rpc_xattrs)
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/rpcmeta.py", line 277, in load_config
    return self._junos.execute(rpc, ignore_warning=ignore_warning)
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/decorators.py", line 76, in wrapper
    return function(*args, **kwargs)
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/decorators.py", line 31, in wrapper
    return function(*args, **kwargs)
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/device.py", line 797, in execute
    errs=ex)
jnpr.junos.exception.RpcError: RpcError(severity: error, bad_element: vlan-id, message: error: syntax error
error: syntax error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/napalm/junos/junos.py", line 236, in _load_candidate
    ignore_warning=self.ignore_warning,
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/utils/config.py", line 539, in load
    ignore_warning=ignore_warning)
  File "/root/rosetta-demo/venv/lib/python3.6/site-packages/jnpr/junos/utils/config.py", line 460, in try_load
    raise ConfigLoadError(cmd=err.cmd, rsp=err.rsp, errs=err.errs)
jnpr.junos.exception.ConfigLoadError: ConfigLoadError(severity: error, bad_element: vlan-id, message: error: syntax error
error: syntax error)

Note: my scripts/code are located within https://github.com/rickdonato/rosetta-demo/tree/master/scripts

The process I follow is:
• create the running-config yang model. scripts/yang-create.py
• create the candidate config yang model. Via modying a copy of the running-config yang.
• obtain the config via nos_driver.merge scripts/push-config.py`
• A config example that I send it shown below. However, any native config generated by Rosetta results in the exception above.

<configuration>
  <vlans>
    <vlan delete="delete">
      <vlan-id>1000</vlan-id>
    </vlan>
    <vlan>
      <vlan-id>2000</vlan-id>
      <name>prod2</name>
      <disable delete="delete"/>
    </vlan>
  </vlans>
</configuration>

• I send this to the device via Napalm but I get the error above.

Any help on this would be appreciated. Everything works great with IOS.

UPDATE: Confirmed working XML via Napalm push. VLANs are slighty different. But it shows main differences...

config = """
 <configuration>
            <vlans>
                <vlan operation="delete">
                    <name>vlan1020</name>
                </vlan>
                <vlan operation="create">
                    <name>prod2</name>
                    <vlan-id>2000</vlan-id>
                </vlan>
            </vlans>
    </configuration>
"""
@jathanism jathanism added the bug Something isn't working label Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants