cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1299
Views
0
Helpful
4
Replies

Move configuration with Copy_tree() method

igotni
Level 1
Level 1

Hi everyone,

I have a problem with the copy_tree() function.

It works when trying to copy configuration from one port to another port or from one lag to another lag, but it doesn't work with services. in the example below I try to copy configuration from a given service customer in device 1 to another service customer in device 2.

cust1 = root.devices.device[_input.device1].config.alu__service.customer["99"]
cust2 = root.devices.device[_input.device2].config.alu__service.customer["99"]
m.copy_tree(t.th, cust1._path, cust2._path)

It generates the folowing error :

Error: badly formatted or nonexistent path (8): Data model mismatch

If you have any idea, don't hesitate to reply pkease.

Thanks in advance.

 

 

 

 

 

 

 

4 Replies 4

yfherzog
Cisco Employee
Cisco Employee

Hi,

 

Have you created the list entry on device 2 before using copy_tree?

Hi,

Yes, of course.

I am looking something like

this NSO cli

rename devices device abc xyz 

In this case we don’t need to create new device. Copy tree works fine but for that I have create new device first that I don’t want to do.

 

may be move is not correct method, I did not find any maapi method for renaming device without creating a new one. Rename does make a copy of same device with new name with the need of list entry present

I have list of 7k devices that I have to rename.

thanks

I think this is another questin you are asking but the answer to yours is:
you can't rename the device without creating a new one because you are changing the KEY of the device in the device list so by changing the "name" you change the unique identifier of the device in the list and so you need to create a new element.
Regards
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: