Merge "Use a UUID instead of a named identity for httpboot"

This commit is contained in:
Zuul 2023-12-07 11:33:40 +00:00 committed by Gerrit Code Review
commit 84fd13e14a
2 changed files with 4 additions and 3 deletions

View File

@ -369,6 +369,7 @@ def system_collection_resource():
@api_utils.ensure_instance_access
@api_utils.returns_json
def system_resource(identity):
uuid = app.systems.uuid(identity)
if flask.request.method == 'GET':
app.logger.debug('Serving resources for system "%s"', identity)
@ -422,7 +423,7 @@ def system_resource(identity):
try:
# Mount it as an ISO
app.systems.set_boot_image(
identity,
uuid,
'Cd', boot_image=image_path,
write_protected=True)
# Set it for our emulator's API surface to return it
@ -468,7 +469,7 @@ def system_resource(identity):
if indicator_led_state:
app.indicators.set_indicator_state(
app.systems.uuid(identity), indicator_led_state)
uuid, indicator_led_state)
app.logger.info('Set indicator LED to "%s" for system "%s"',
indicator_led_state, identity)

View File

@ -292,7 +292,7 @@ class SystemsTestCase(EmulatorTestCase):
set_http_boot_uri = systems_mock.return_value.set_http_boot_uri
set_boot_device.assert_called_once_with('xxxx-yyyy-zzzz', 'Cd')
set_boot_image.assert_called_once_with(
'xxxx-yyyy-zzzz',
mock.ANY,
'Cd',
boot_image='/path/to/file.iso',
write_protected=True)