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

Made templates product-specific. #4841

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

matejak
Copy link
Member

@matejak matejak commented Sep 13, 2019

Template variables and backends can be product-qualified.
Value of foo@rhel7 overwrites foo on rhel7, while value of foo will be the default
for other products.

Needed for #4820 to work properly.

Template variables and backends can be product-qualified.
Value of foo@rhel7 overwrites foo on rhel7, while value of foo will be the default
for other products.
@jan-cerny jan-cerny self-assigned this Sep 16, 2019
@jan-cerny jan-cerny added this to the 0.1.47 milestone Sep 16, 2019
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

Thanks, this works for me.

not_specific_backends = self.template.get("backends", dict())
specific_backends = self._make_items_product_specific(
not_specific_backends, product_suffix, True)
self.template["backends"] = specific_backends
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note to myself: This means that "backends" will be always defined, so i we have some time we can drop the else branch or update the code in https://github.com/ComplianceAsCode/content/blob/master/ssg/templates.py#L152

@jan-cerny jan-cerny merged commit 1c5fbd4 into ComplianceAsCode:master Sep 16, 2019
@matejak matejak deleted the specific_templates branch October 9, 2019 11:46
This pull request was closed.
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.

2 participants