nornir-automation / nornir_napalm

NAPALM's plugins for nornir
Apache License 2.0
62 stars 20 forks source link

Change encoding for eapi responses to json #50

Open siguroot opened 1 year ago

siguroot commented 1 year ago

Is it possible to set the desired encoding type returned by eapi. It seems to default to 'text', however json would be much more desirable. In napalm I normally do this via cmd = device.cli(['show interfaces transceiver detail'], encoding='json')

Is there a way to pass encoding='json' to cli in nornir_napalm?

ktbyers commented 1 year ago

https://github.com/nornir-automation/nornir_napalm/blob/master/nornir_napalm/plugins/tasks/napalm_cli.py#L8

It looks like you would need to add do a PR to add support for the encoding argument which is not passed (right now).

siguroot commented 1 year ago

I have submitted a PR. Never done one before so go easy on me! Open to any feedback/suggestions.