cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
483
Views
0
Helpful
4
Replies
Highlighted
Beginner

Move configuration with Copy_tree() method

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.

 

 

 

 

 

 

 

Everyone's tags (2)
4 REPLIES 4
Highlighted
Cisco Employee

Re: Move configuration with Copy_tree() method

Hi,

 

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

Highlighted
Beginner

Re: Move configuration with Copy_tree() method

Hi,

Yes, of course.

Highlighted
Cisco Employee

Re: Move configuration with Copy_tree() method

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

Highlighted
Cisco Employee

Re: Move configuration with Copy_tree() method

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