Skip to content

Fix: Artifact pull failing when running cmf init ssh#331

Open
AyeshaSanadi wants to merge 6 commits intoHewlettPackard:masterfrom
varkha-d-sharma:failed_artifact_pull
Open

Fix: Artifact pull failing when running cmf init ssh#331
AyeshaSanadi wants to merge 6 commits intoHewlettPackard:masterfrom
varkha-d-sharma:failed_artifact_pull

Conversation

@AyeshaSanadi
Copy link
Collaborator

Related Issues / Pull Requests

List all related issues and/or pull requests if there are any.

Description

Include a brief summary of the proposed changes.

What changes are proposed in this pull request?

  • The original code used sftp.put() (which uploads to remote) instead of sftp.get() (which downloads from remote). Fixed in both download_file and download_directory.
  • Wrong variable in download_directory inner loop: Original passed object_name (the .dir manifest path) to sftp.put() for every file instead of temp_object_name (the individual file's content-addressed path).
  • Size integrity check fixed in download_file: Original used os.stat(object_name).st_size — a local stat() on a remote path string, which would fail. Fixed to use remote stat before download and local stat after.
  • Connection reuse via _get_connection() + auto-close via __del__.

Checklist:

  • My code follows the style guidelines of this project (PEP-8 with Google-style docstrings).
  • My code modifies existing public API, or introduces new public API, and I updated or wrote docstrings that
    uses Google-style formatting and any other formatting that is supported by mkdocs and plugins this project
    uses.
  • I have commented my code.
  • My code requires documentation updates, and I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

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