Skip to content

ngclient: Create directories as needed - #2808

Merged
jku merged 1 commit into
theupdateframework:developfrom
jku:create-dirs-as-needed
Mar 9, 2025
Merged

ngclient: Create directories as needed#2808
jku merged 1 commit into
theupdateframework:developfrom
jku:create-dirs-as-needed

Conversation

@jku

@jkujku commented Mar 7, 2025

Copy link
Copy Markdown
Member

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

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 ownerMarch 7, 2025 12:48

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

Copy link
Copy Markdown
MemberAuthor

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

@jkujku mentioned this pull request Mar 7, 2025

@kairoaraujokairoaraujo left a comment

Copy link
Copy Markdown
Contributor

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:developMar 9, 2025
Sign up for freeto 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

@jku@kairoaraujo