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

Store the container annotation in the "containers" directory #1626

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

mlschroe
Copy link
Member

Like the OBS worker does.

@mlschroe mlschroe force-pushed the master branch 2 times, most recently from d1e8d8b to b04d220 Compare September 11, 2024 11:05
Copy link
Member

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

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

wfm

Comment on lines +1326 to +1327
if not os.path.exists("containers"):
os.makedirs("containers")
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace with os.makedirs("containers", exist_ok=True).
Your code is longer and is prone to race conditions.

Comment on lines +1328 to +1329
with open("containers/annotation", "wb") as f:
f.write(bi.containerannotation.encode())
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't be better to avoid encoding to bytes?

            with open("containers/annotation", "w", encoding="utf-8") as f:
                f.write(bi.containerannotation)

@dmach dmach merged commit 4ccb00b into openSUSE:master Oct 14, 2024
23 of 24 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.

3 participants