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

[Backport release/3.32] CRAYSAT-1917: Fix jinja2 rendering of boot_sets data in sat bootprep #284

Open
wants to merge 3 commits into
base: release/3.32
Choose a base branch
from

Conversation

github-actions[bot]
Copy link

Backport of #280

Make the following fixes:

- Remove the `boot_set` property from `BaseInputItem`. It is not appropriate
  there, and it is redundant with `boot_sets` property that already exists in
  the `InputSessionTemplate`
- Modify the `jinja_rendered` decorator to recursively render more complex
  objects like lists and dictionaries. I think this is safe, but we should
  consider any edge cases more carefully.
- Remove the now unnecessary code that does a one-off Jinja2 rendering of
  `rootfs_provider_passthrough` in the `boot_sets`.

Could still use unit test enhancements that test this new ability to render
fields in the boot_sets.

Test Description:
Tested on a simple bootprep input file that used a variable in the
`rootfs_provider_passthrough` field of a boot set in a BOS session template.

(cherry picked from commit 71ef427)
Add unit tests for usage of the `jinja_rendered` decorator on properties
of the `BaseInputItem`.

Modify these unit tests to simplify them slightly and to ensure that the
`SomeTestItem` class calls the `BaseInputItem` constructor, so that it
sets the `jinja_env` instance attribute, which is used by the
`jinja_rendered` decorator.

Test Description:
Unit tests pass.

(cherry picked from commit 6e42a20)
Update the unit tests of the InputSessionTemplate class to include tests
that check for proper Jinja2 template rendering of the boot_sets field.

(cherry picked from commit 8ff2874)
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