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

Commits on Nov 11, 2024

  1. CRAYSAT-1917: Fix jinja2 rendering of boot_sets data in sat bootprep

    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)
    haasken-hpe committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    e931d04 View commit details
    Browse the repository at this point in the history
  2. CRAYSAT-1917: Add unit tests for jinja_rendered decorator

    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)
    haasken-hpe committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    7e1e568 View commit details
    Browse the repository at this point in the history
  3. CRAYSAT-1917: Update unit tests for jinja_rendered support of boot_sets

    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)
    haasken-hpe committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    f6c8590 View commit details
    Browse the repository at this point in the history