Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CRAYSAT-1841: Add support for CFS v2 or v3 to
sat bootprep
Add support for using either the CFS v2 or v3 API in `sat bootprep` based on the value of the command-line option `--cfs-version` or the config-file option `cfs.api_version`. Before this change, `sat bootprep` was hard-coded to always use CFS v2. Update the `InputConfiguration`, `InputConfigurationLayer`, and `AdditionalInventory` classes to keep a reference to the instance of the version-specific subclass of `CFSClientBase`, so that they can delegate operations to the appropriate version of the CFS API. This removes a lot of code that required knowledge of the CFS API and instead uses classes and methods defined in the `csm_api_client` library, which has already been updated to support both CFS v2 and v3. This should reduce code duplication across `sat` and `csm_api_client`. Some unit tests are no longer needed here because that functionality is tested in the `csm_api_client` instead. Other unit tests are updated to include the `cfs_client` instance that needs to be passed into the input layer and configuration objects. This also makes the `playbook` property required in the schema because the CFS v3 API requires that the playbook be specified. This is technically a backwards-incompatible schema change because it can invalidate certain bootprep input files if they define layers without playbooks. The default bootprep files contain a playbook for every layer and do not depend on the CFS default playbook value, so this should be a pretty safe and non-disruptive change. Test Description: Unit tests only so far. Still needs to be tested on a real system.
- Loading branch information