ā11-22-2020 12:31 AM - edited ā11-22-2020 01:18 AM
Hi,
while implementing the example located at (https://github.com/NSO-developer/Cisco-NSO-MPLS-VPN-service-reconciliation-example), I am getting python runtime error shown below on NSO 5.3 and Ubuntu 14.04 LTS.
admin@ncs(config)# vpn l3vpn-service-discovery dry-run
Error: Python cb_action error. name 'unicode' is not defined
admin@ncs(config)#
the code of this is located at (https://github.com/NSO-developer/Cisco-NSO-MPLS-VPN-service-reconciliation-example/blob/master/packages/l3vpn/python/action.py)
the specific lines of code which relate to error in this example are as below ,kindly advise if the code can be modified to support libraries in NSO-5.3. Thanks.
[.......]
@Action.action
def cb_action(self, uinfo, name, kp, input, output):
[.......]
for interface in cpe_device.config.ios__interface.GigabitEthernet:
if (interface.description == "%s local network" % service_name):
endpoint_interface = "GigabitEthernet%s" % interface.name
int_address= interface.ip.address.primary.address
int_mask = interface.ip.address.primary.mask
interface = ipaddress.IPv4Interface(unicode('%s/%s' % (int_address,int_mask), "utf-8"))
endpoint_network = str(interface.network)
[.......]
Solved! Go to Solution.
ā11-24-2020 09:30 AM
Thanks for your reply vleijon, That link is really helpful.
only change i did was and it worked!!!
interface = ipaddress.IPv4Interface(('%s/%s' % (int_address,int_mask)))
ā11-22-2020 07:55 AM
ā11-24-2020 09:30 AM
Thanks for your reply vleijon, That link is really helpful.
only change i did was and it worked!!!
interface = ipaddress.IPv4Interface(('%s/%s' % (int_address,int_mask)))
ā11-24-2020 10:00 AM
ā11-24-2020 12:11 PM
Hi, here are some points which I believe needed for github repo.
1)The service portion using Java did not compiled on NSO 5.3, so I believe service portion of the code needs to be updated in Java or Python for it to run on NSO 5.3.
2) Make file needs to be updated with exact NED ids , right now its using generic.
3) I was unable to find any existing policy-map section mentioned in readme.md workflow instructions, as a work around I used the command "$ncs-netsim cli-c pe0' and removed existing subinterface from XR, and then applied reconcile function . later on I also tested it with the policy-map and it worked .Thanks.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide