Skip to content

Only parse profiles from subimages and includes if those are dirs#3423

Merged
daandemeyer merged 2 commits intosystemd:mainfrom
daandemeyer:profile
Jan 24, 2025
Merged

Only parse profiles from subimages and includes if those are dirs#3423
daandemeyer merged 2 commits intosystemd:mainfrom
daandemeyer:profile

Conversation

@daandemeyer
Copy link
Copy Markdown
Contributor

No description provided.

@daandemeyer daandemeyer force-pushed the profile branch 3 times, most recently from a97972d to e793573 Compare January 24, 2025 12:31
With all the chdir() we do while parsing configuration, let's make
sure our config paths are absolute so that they don't suddenly
change meaning when we chdir().
Comment thread mkosi/config.py
s: Optional[ConfigSetting[object]] # Hint to mypy that we might assign None
extras = path.is_dir()

assert path.is_absolute()
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.

For typing assert is fine, but we shouldn't use it for errors.

Suggested change
assert path.is_absolute()
if not path.is_absolute():
raise ValueError(f'{path} is not absolute')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@behrmann This is a programming error, not a user error, so an assert fits better imo

@daandemeyer daandemeyer merged commit 4df696b into systemd:main Jan 24, 2025
@daandemeyer daandemeyer deleted the profile branch January 24, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants