NSO-developer/ncs_pycli

When NCS is down we can provide a simple message by catching the exception.

kirankotari opened this issue · 2 comments

~/c/verizon-nso-packages ⨯ ncs_pycli 07:37:44
Traceback (most recent call last):
File "/Users/kkotari/.pyenv/versions/3.7.4/bin/ncs_pycli", line 8, in
sys.exit(run())
File "/Users/kkotari/.pyenv/versions/3.7.4/lib/python3.7/site-packages/ncs_pycli/ncs_pycli.py", line 143, in run
obj.initialize(sys.argv)
File "/Users/kkotari/.pyenv/versions/3.7.4/lib/python3.7/site-packages/ncs_pycli/ncs_pycli.py", line 113, in initialize
m = ncs.maapi.Maapi()
File "/Users/kkotari/csco/nso-5.2.3/src/ncs/pyapi/ncs/maapi.py", line 180, in init
self.msock = connect(ip, port, path)
File "/Users/kkotari/csco/nso-5.2.3/src/ncs/pyapi/ncs/maapi.py", line 96, in connect
_tm.maapi.connect(msock, ip, port)
_ncs.error.Error: system call failed (24): Failed to connect to ConfD: Connection refused

Absolutely, Ill take a look at it as soon as I can, or if you have the time you might take a stab at it?

@hniska I am working on it, I will be creating a new PR for it.