napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.24k stars 551 forks source link

IOS-XR NETCONF - Create clearer error indication messages when "cli" is not supported #1389

Open ktbyers opened 3 years ago

ktbyers commented 3 years ago

This is on a connection.load_replace_candidate(filename=filename) operation

Using:

iosxr_netconf:
  device_type: iosxr_netconf
  hostname: device.domain.com
  username: admin
  password: password
  optional_args:
    config_encoding: cli 
E           napalm.base.exceptions.ReplaceConfigException: 

{'info': '<?xml version="1.0" encoding="UTF-8"?><error-info '
         'xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" '
         'xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">\n'
         '   <bad-element>cli</bad-element>\n'
         '   '
         '<bad-namespace>http://cisco.com/ns/yang/Cisco-IOS-XR-cli-cfg</bad-namespace>\n'
         '  </error-info>\n'
         ' ',
 'message': None,
 'path': None,
 'severity': 'error',
 'tag': 'unknown-namespace',
 'type': 'protocol'}

We should indicate that "cli" is not supported on this platform and the minimum IOS-XR version where "cli" is supported.

ktbyers commented 3 years ago

@neelimapp

neelimapp commented 3 years ago

Sure, Kirk, will add that.