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

Protect parsing of data types from empty lines #375

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

lbetz
Copy link
Contributor

@lbetz lbetz commented Aug 28, 2024

If parsing empty rows in data type files the method first returns an nil class so strip doesn't work anymore.

@evgeni
Copy link
Member

evgeni commented Aug 28, 2024

Thanks Lennart!

The rubocop failure is unrelated (fix in #376, which is merged, feel free to rebase on that).

Could you add a test for the empty line behaviour you're fixing?

lib/kafo/data_type_parser.rb Outdated Show resolved Hide resolved
lib/kafo/data_type_parser.rb Outdated Show resolved Hide resolved
@evgeni
Copy link
Member

evgeni commented Sep 16, 2024

Applied suggestion and added a test.

@evgeni evgeni force-pushed the data-types-empty-lines branch from 5157238 to 6016d4b Compare September 16, 2024 09:30
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Btw, long term I'd still prefer to make this depend on puppet-strings to extract the actual data types instead of attempting to maintain yet another parser. Short term this is a good fix.

@evgeni evgeni merged commit c1ff767 into theforeman:master Sep 16, 2024
6 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.

4 participants