ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.59k stars 1.3k forks source link

f5 send_config_set error #2068

Closed Trasmontinho closed 9 months ago

Trasmontinho commented 3 years ago

Hello,

I've met an error in f5 devices when I tried to use the command send_config_set on f5 devices.

The error is below : result = net_connect.send_config_set(config_commands=config_commands, **kwargs) File "/usr/local/lib/python3.6/dist-packages/netmiko/base_connection.py", line 1872, in send_config_set output += self.exit_config_mode() File "/usr/local/lib/python3.6/dist-packages/netmiko/base_connection.py", line 1754, in exit_config_mode raise ValueError("Failed to exit configuration mode") ValueError: Failed to exit configuration mode

I've solved it by adding the missing functions in the F5TmshSSH class like :

    def config_mode(self, config_command=""):
        "No config mode for Fortinet devices."""
         return ""

    def exit_config_mode(self, exit_config=""):
        """No config mode for Fortinet devices."""
        return ""

Do you think that could be an enhancement to this module ?

If so I can create the pull request and the supply the class file modified.

Thanks for your answer,

Regards, Sam

ktbyers commented 3 years ago

@Trasmontinho I really need someone to run the full set of Netmiko Tests against the F5 devices (show and config tests). Tests are here:

https://github.com/ktbyers/netmiko/blob/develop/TESTING.md

But I am also probably willing to just accept fix also...i.e. it would be best if we did both (i.e. fix and run the full set of tests), but if we can't get that done, then just this fix is probably fine.

Kirk

Trasmontinho commented 3 years ago

Hello @ktbyers,

I’ll reserve some time this week to do so.

keep you posted on it.

regards,

Sam

ktbyers commented 3 years ago

@Trasmontinho Sounds good.

Kirk

Trasmontinho commented 3 years ago

Hi @ktbyers,

I've done the testing all passed and skipped parsing stuff on the show cli as there's no template for it . How do you would like to proceed on it? Is there some logs to join to the pull request ?

Regards,

Sam

ktbyers commented 3 years ago

@Trasmontinho Simplest solution is to create a PR and then include the test PASS/FAIL output in the PR comments.

Trasmontinho commented 3 years ago

Ok I'll do so. I'll propose a test set for F5 checks also.

ktbyers commented 3 years ago

Great...the F5 driver was created a long time ago so I have very little visibility into how well it works...so it would be good/nice to make improvements here.

Kirk

ktbyers commented 9 months ago

Purging old issues...