Skip to content

Commit

Permalink
Merge pull request #253 from Cray-HPE/CRAYSAT-1330-cfs-rename-parameter
Browse files Browse the repository at this point in the history
CRAYSAT-1330: Specify image name directly in CFS session when possible
  • Loading branch information
haasken-hpe authored Aug 9, 2024
2 parents 3e162cd + ec2a1fd commit 7088e90
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.30.0] - 2024-08-09

### Changed
- When customizing images with `sat bootprep`, pass the desired image name
directly to CFS when creating the image customization session, if supported by
the version of CFS on the system. This improves the performance and
reliability of `sat bootprep`.
- Update to a new version of the `csm-api-client` that allows querying the CFS
version from the CFS API.
- Update to version 3.0.2 of the `semver` package. The only breaking change
appears to be related to supported Python versions, but it should not affect
SAT.

## [3.29.2] - 2024-08-06

### Changed
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ coverage==6.3.2
cray-product-catalog==1.6.0
croniter==0.3.37
cryptography==42.0.4
csm-api-client==1.2.4
csm-api-client==2.0.0
dataclasses-json==0.5.6
docutils==0.17.1
google-auth==2.6.0
Expand Down Expand Up @@ -54,7 +54,7 @@ requests==2.32.2
requests-oauthlib==1.3.1
rsa==4.8
s3transfer==0.5.2
semver==2.13.0
semver==3.0.2
six==1.16.0
snowballstemmer==2.2.0
Sphinx==2.4.5
Expand Down
4 changes: 2 additions & 2 deletions requirements.lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ click==8.0.4
cray-product-catalog==1.6.0
croniter==0.3.37
cryptography==42.0.4
csm-api-client==1.2.4
csm-api-client==2.0.0
dataclasses-json==0.5.6
google-auth==2.6.0
htmlmin==0.1.12
Expand Down Expand Up @@ -45,7 +45,7 @@ requests==2.32.2
requests-oauthlib==1.3.1
rsa==4.8
s3transfer==0.5.2
semver==2.13.0
semver==3.0.2
six==1.16.0
sseclient-py==1.7.2
toml==0.10.0
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ argcomplete
boto3
botocore
cray-product-catalog >= 1.6.0
csm-api-client >= 1.2.4, <2.0
csm-api-client >= 2.0.0, <3.0
croniter >= 0.3, < 1.0
inflect >= 0.2.5, < 3.0
Jinja2 >= 3.0, < 4.0
Expand All @@ -36,7 +36,7 @@ python-dateutil >= 2.7.3, < 3.0
pyyaml >= 6.0.1, < 7.0
requests < 3.0
requests-oauthlib
semver >= 2.13.0, < 3.0
semver >= 3.0.2, < 4.0
sseclient-py >= 1.7
toml == 0.10.0
urllib3 >= 1.26.5, < 2.0
14 changes: 11 additions & 3 deletions sat/cli/bootprep/input/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,21 @@ def rename_configured_image(self):
if not configured_image_id:
raise ImageCreateError('Failed to determine ID of configured image.')

LOGGER.info(f'Renaming configured image with ID {configured_image_id} to {self.name}')
if self.cfs_client.supports_customized_image_name:
LOGGER.debug(f'No rename necessary since CFS supports naming the configured '
f'image {self.name}')
self.final_image_id = configured_image_id
return

rename_description = f'configured image with ID {configured_image_id} to {self.name}'
LOGGER.info(f'Renaming {rename_description}')

try:
self.final_image_id = self.ims_client.rename_image(configured_image_id, self.name)
except APIError as err:
raise ImageCreateError(f'Failed to rename configured image with ID {configured_image_id} '
f'from {self.created_image_name} to {self.name}: {err}')
raise ImageCreateError(f'Failed to rename {rename_description}: {err}')

LOGGER.info(f'Renamed {rename_description}')

def delete_overwritten_images(self):
"""Delete the images which were marked to be overwritten
Expand Down

0 comments on commit 7088e90

Please sign in to comment.