Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngclient: Create directories as needed #2808

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

jku
Copy link
Member

@jku jku commented Mar 7, 2025

Make sure ngclient creates metadata and artifact directories when needed.

This was not useful when caller needed to populate the metadata dir with the initial root anyway, but now with boostrap argument it becomes a usability improvement.

Fixes #2807

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Make sure ngclient creates metadata and artifact directories
when needed.

This was not useful when caller needed to populate the metadata dir with
the initial root anyway, but now with boostrap argument it becomes a
usability improvement.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@jku jku requested a review from a team as a code owner March 7, 2025 12:48
@@ -267,6 +268,7 @@ def download_target(

if filepath is None:
filepath = self._generate_target_file_path(targetinfo)
Path(filepath).parent.mkdir(exist_ok=True, parents=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a case where Pathlib is much more ergonomic so I'm using it even though we don't use Paths generally

@jku jku mentioned this pull request Mar 7, 2025
Copy link
Contributor

@kairoaraujo kairoaraujo left a comment

Choose a reason for hiding this comment

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

LGTM

@jku jku merged commit 15933a9 into theupdateframework:develop Mar 9, 2025
17 checks passed
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.

ngclient: allow metadata dir to not exist
2 participants