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

Fixes #37433 - Set indentation when calling subscription_manager_setup #10153

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jpasqualetto
Copy link
Contributor

Adding proper indentation when calling snippet subscription_manager_setup

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.

I'd argue the rest of the subman code should be not indented since at the bash level they're not conditional. The Ruby conditionals shouldn't matter for the end result.

@jpasqualetto
Copy link
Contributor Author

jpasqualetto commented May 10, 2024

The problem I'm trying to solve is the final rendered result of cloud_init_default.erb.

subscription_manager_setup.erb is fine.

redhat_register.erb is also fine and generates valid bash script.

However, when rendered, redhat_register.erb result does not have the same indentation. Code that comes from redhat_register.rb have 2 space indentation, but what is generated by the snippet has no indentation at all. That's fine if that result is simply being processed by bash.

The problem is that cloud_init_default.erb (which consumes redhat_register.erb) is supposed to generate a valid yaml as result. With that difference on indentation coming from redhat_register.erb its result is not a valid yaml.

I wouldn't mind if we removed all the indentation from redhat_register.erb. That would do the trick too. What matters is that the rendered result should have the same indentation.

@ShimShtein
Copy link
Member

@ekohl , this is how the template looks like when it's rendered without the indentation:
image

If we indent the internal snippet, it will pass the validation:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants