napalm-automation / napalm

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

IOS-XR NETCONF - XML config replace unable to use get_config() 'running' output. #1390

Open ktbyers opened 3 years ago

ktbyers commented 3 years ago

On the following device:

#show version
Sun Mar  7 21:49:49.606 UTC
Cisco IOS XR Software, Version 6.5.3
Copyright (c) 2013-2019 by Cisco Systems, Inc.

Build Information:
 Built By     : ahoang
 Built On     : Tue Mar 26 06:52:25 PDT 2019
 Built Host   : iox-ucs-019
 Workspace    : /auto/srcarchive13/prod/6.5.3/xrv9k/ws
 Version      : 6.5.3
 Location     : /opt/cisco/XR/packages/

cisco IOS-XRv 9000 () processor
System uptime is 21 weeks 3 days 18 hours 34 minutes

If I try to do a:

filename = "initial_config.xml"
device.load_replace_candidate(filename=filename)

Where initial_config.xml is the output of get_config()["running"] (using 'xml'). I receive the following error:

<napalm.iosxr_netconf.iosxr_netconf.IOSXRNETCONFDriver object at 0x7fa5dbdbc828>
tag didn't have any child elements
Traceback (most recent call last):
  File "/home/kbyers/NAPALM/napalm/napalm/iosxr_netconf/iosxr_netconf.py", line 212, in load_replace_candidate
    self.device.copy_config(source=configuration, target="candidate")
  File "/home/kbyers/VENV/incendio_test/lib/python3.6/site-packages/ncclient/manager.py", line 236, in execute
    huge_tree=self._huge_tree).request(*args, **kwds)
  File "/home/kbyers/VENV/incendio_test/lib/python3.6/site-packages/ncclient/operations/edit.py", line 106, in request
    return self._request(node)
  File "/home/kbyers/VENV/incendio_test/lib/python3.6/site-packages/ncclient/operations/rpc.py", line 349, in _request
    raise self._reply.error
ncclient.operations.rpc.RPCError: tag didn't have any child elements

Should this operation be supported? If not what is the proper process for getting the full configuration of a device via XML to use with load_replace_candiate?

Regards, Kirk

ktbyers commented 3 years ago

@neelimapp