netdev icon indicating copy to clipboard operation
netdev copied to clipboard

await send_command not accepting 'use_textfsm=True'

Open walidamer711 opened this issue 7 years ago • 5 comments

While trying add use_textfsm=True to send_commad function it raises the below error.

Traceback (most recent call last): File "async-ssh.py", line 51, in main() File "async-ssh.py", line 46, in main print(task.result()) File "async-ssh.py", line 30, in collect_output command_result = await connection.send_command(command,use_textfsm=True) TypeError: send_command() got an unexpected keyword argument 'use_textfsm' Task exception was never retrieved future: <Task finished coro=<collect_output() done, defined at async-ssh.py:24> exception=TypeError("send_command() got an unexpected keyword argument 'use_textfsm'",)> Traceback (most recent call last): File "async-ssh.py", line 30, in collect_output command_result = await connection.send_command(command,use_textfsm=True) TypeError: send_command() got an unexpected keyword argument 'use_textfsm'

walidamer711 avatar Sep 27 '18 16:09 walidamer711

Hello, @walidamer711 ! My library doesn't support textfsm, but it's interesting. What do you expect from using this args "use_textfsm=True"?

selfuryon avatar Sep 28 '18 18:09 selfuryon

Hello, In reference to the below link, netmiko now support passing this parameter "use_textfsm=True" along with send_command() in order to return structured data parsed with ready textfsm templates created in ntc-templates. So it is all about getting structured data.

https://pynet.twb-tech.com/blog/automation/netmiko-textfsm.html

if you can add this to your library, that will be great. Thanks

walidamer711 avatar Oct 02 '18 05:10 walidamer711

Oh, it's a great idea! I will realize it in the next release!

selfuryon avatar Oct 04 '18 10:10 selfuryon

@selfuryon i'm interested to work on this, you can assign it to me.

Ali-aqrabawi avatar May 15 '19 16:05 Ali-aqrabawi

Related PR #33

selfuryon avatar May 19 '19 14:05 selfuryon