Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client initialization needs to be moved ahead for delete_xpath operation #82

Open
mahen-g opened this issue Jul 28, 2020 · 1 comment
Open
Labels
bug Something isn't working cli

Comments

@mahen-g
Copy link

mahen-g commented Jul 28, 2020

cisco-gnmi set 10.30.115.66:50051 -os NX-OS -root_certificates gnmi.pem -ssl_target_override ems.cisco.com -delete_xpath "/interfaces/interface[name='eth1/7']/subinterfaces/subinterface[index=0]/ipv4/addresses/address"
Username: admin
Password:

/ws/mgangaia-sjc/pyats-latest/lib/python3.6/site-packages/cisco_gnmi/cli.py(292)gnmi_set()
-> if args.delete_xpath:
(Pdb) c
ERROR:root:Error during usage!
Traceback (most recent call last):
File "/ws/mgangaia-sjc/pyats-latest/lib/python3.6/site-packages/cisco_gnmi/cli.py", line 80, in main
rpc_mapargs.rpc
File "/ws/mgangaia-sjc/pyats-latest/lib/python3.6/site-packages/cisco_gnmi/cli.py", line 292, in gnmi_set
if args.delete_xpath:
UnboundLocalError: local variable 'client' referenced before assignment

Thanks,
Mahendra

@mahen-g
Copy link
Author

mahen-g commented Jul 30, 2020

Also, line 295, needs to be the below. Insted of args.xpath, it should be args.delete_xpath

delete_response = client.delete_xpaths(args.delete_xpath)

@remingtonc remingtonc added bug Something isn't working cli labels Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

No branches or pull requests

2 participants