Skip to content

Add file_pull option to Cisco IOS devices#345

Merged
jeffkala merged 11 commits intodevelopfrom
u/smk4664/file-copy-url
Feb 27, 2026
Merged

Add file_pull option to Cisco IOS devices#345
jeffkala merged 11 commits intodevelopfrom
u/smk4664/file-copy-url

Conversation

@smk4664
Copy link
Contributor

@smk4664 smk4664 commented Feb 18, 2026

This PR add the ability to have the Cisco IOS devices download the files instead of relying on copying the files to the device through scp. I am using the dataclass FilePullSpec to simplify the required arguments when downloading the files instead of copying them through scp.

Ignore the import position as Ruff is handling that.
Copy link
Contributor

@jeffkala jeffkala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good to me.

@smk4664 smk4664 marked this pull request as draft February 24, 2026 16:42
The find command was too greedy and capturing files ignore by the pylint config in pyproject.toml.  This allows pylint to use the pyproject.tom.
Not all Devices use netmiko, these changes allow other devices to also implement fix exist validation.
@smk4664 smk4664 marked this pull request as ready for review February 25, 2026 18:34
Comment on lines +741 to 747
if not self.verify_file(local_checksum, dest, file_system=file_system):
log.error(
"Host %s: Attempted file copy, but could not validate file existed after transfer %s",
self.host,
FileTransferError.default_message,
)
raise FileTransferError

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure how this works nested in an if statement performing the same action. I feel like there could be a better way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I don't want the check to run twice if the file actually verified. But I do want to validate that the file was copied after the copy finishes. And sharing that, I now realize that I did not indent on the remote_file_copy. So, I am pushing a new commit to indent.

smk4664 and others added 3 commits February 25, 2026 15:52
@jeffkala jeffkala merged commit db3b68a into develop Feb 27, 2026
15 checks passed
@jeffkala jeffkala mentioned this pull request Mar 3, 2026
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.

4 participants