cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1005
Views
0
Helpful
2
Replies

NSO - Xpath with space on Python section

Maurizio Bau
Level 1
Level 1

Hi Guys

 

I want to configure a new PWE3 via action packages.

I found a xpath and keypath on show running devices device ....

/devices/device{9K1}/config/cisco-ios-xr:l2vpn/xconnect/group{TEST}/p2p{TEST_P2P}/neighbor{172.16.12.8 123456789}/ip-version ipv4

For configure new entry similar this, i created this path

_PYTHON
n = devicePointer.config.cisco_ios_xr__l2vpn.xconnect.group[PW.group].p2p[PW.p2p].neighbor[PW.neighbor][PW.pwIdNew]

When action package starting, nso logging this message

 

Error: Python cb_action error. badly formatted or nonexistent path (8): Bad key "172.16.12.8" (wrong number of identifiers) at: /devices/device/config/l2vpn/xconnect/group/p2p/neighbor

 

Question is

When xpath have parameters trough graph par { }, what method i can use to migrate on python section.

4 example

neighbor{172.16.12.8 123456789}/

???

 

Thanks

Maurizio

 

 

1 Accepted Solution

Accepted Solutions

rslaski
Spotlight
Spotlight

This seems like a list with multiple keys, have you tried this?

neighbor[PW.neighbor, PW.pwIdNew]

View solution in original post

2 Replies 2

rslaski
Spotlight
Spotlight

This seems like a list with multiple keys, have you tried this?

neighbor[PW.neighbor, PW.pwIdNew]

Hi rslaski

Correct with double parenthesis

n = devicePointer.config.cisco_ios_xr__l2vpn.xconnect.group[PW.group].p2p[PW.p2p].neighbor[[PW.neighbor][PW.pwIdNew]]

 

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: