Skip to content

Fix operations to use native_ssh instead of nx-api#387

Open
mattmiller87 wants to merge 2 commits into
developfrom
u/mattmiller/nxos_bugfix
Open

Fix operations to use native_ssh instead of nx-api#387
mattmiller87 wants to merge 2 commits into
developfrom
u/mattmiller/nxos_bugfix

Conversation

@mattmiller87
Copy link
Copy Markdown
Contributor

@mattmiller87 mattmiller87 commented May 14, 2026

New Pull Request

I am solving a bug when running nxos_device.py. This PR accomplishes that.
It also solves a potential issue when stringing multiple methods together, where port is the same for nx-api and netmiko. I have added api_port for use in nx-api.

In the process of creating api_port, I found an issue where some commands use nx-api and others use netmiko via ssh. I have a few ideas on how to solve this; please let me know if you'd like to discuss further.

Change Notes

Fixed _build_url_copy_command_simple to return a string.
Fixed _get_file_system and _get_free_space to use native_ssh; initial intent when created.
Fixed the remote_file_copy prompts to detect needing to enter a vrf if one isn't provided.
Changed nxos __init__ to accept api_port when running nx-api allowing port to be specific to netmiko.

Justification

The copy command return from _build_url_copy_command_simple should not be a tuple.
remote_file_copy method is using native_ssh and _get_file_systemand_get_free_space` should be using it too.
nxos_device currently is a mix of nx-api and netmiko commands. To run a save, it calls nx-api. To run a remote file copy, it uses ssh.

Note: unittest changes were written with AI

@mattmiller87 mattmiller87 force-pushed the u/mattmiller/nxos_bugfix branch 2 times, most recently from 4864906 to 428cfa6 Compare May 14, 2026 14:57
@mattmiller87 mattmiller87 force-pushed the u/mattmiller/nxos_bugfix branch from 428cfa6 to b4a3f78 Compare May 14, 2026 15:34
@mattmiller87 mattmiller87 marked this pull request as draft May 14, 2026 16:24
@mattmiller87 mattmiller87 force-pushed the u/mattmiller/nxos_bugfix branch from cacc60c to 9b5c676 Compare May 14, 2026 19:42
@mattmiller87 mattmiller87 marked this pull request as ready for review May 14, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant