netcfgbu icon indicating copy to clipboard operation
netcfgbu copied to clipboard

HP Procurve connector, ANSI escape codes in the output

Open antonalekseev opened this issue 4 years ago • 1 comments

When I was working on a connector for HP Procurve device, initially in order to handle annoying login banner asking to press a key to actually get to a CLI prompt, but despite the fact that the banner was handled properly with custom login(), read_until_prompt() hadn't matched the prompt pattern. The issue was caused by the presence of ANSI escape codes in the output. I managed to workaround it by incorporating strip_ansi_escape_codes() function from https://github.com/ktbyers/netmiko/blob/0aa11265ea962f743f0ffa97d35ed4fa9aa0837d/netmiko/base_connection.py#L1777 in custom read_until_prompt() within my connector.

Are you interested in a PR which includes connector for HP Procurve in the code base and if so maybe there is more elegant way to handle the issue with escape codes?

antonalekseev avatar Jul 30 '21 15:07 antonalekseev

Hi @antonalekseev - My apologies for being MIA for a while. I am curious if you have found a "more elegant way". I've also been tracking news of netmiko of their new version; not sure how that might better/affect. Please let me know.

As a next step you are welcome to issue the PR and I will review it to see what it is doing.

jeremyschulman avatar Aug 14 '21 14:08 jeremyschulman