diff options
Diffstat (limited to 'ironic/drivers/modules/agent.py')
-rw-r--r-- | ironic/drivers/modules/agent.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py index f309a1011..2dcd8a819 100644 --- a/ironic/drivers/modules/agent.py +++ b/ironic/drivers/modules/agent.py @@ -471,6 +471,13 @@ class AgentDeploy(CustomAgentDeploy): deploy_utils.check_for_missing_params(params, error_msg) + image_type = node.instance_info.get('image_type') + if image_type and image_type not in images.VALID_IMAGE_TYPES: + raise exception.InvalidParameterValue( + _('Invalid image_type "%(value)s", valid are %(valid)s') + % {'value': image_type, + 'valid': ', '.join(images.VALID_IMAGE_TYPES)}) + # NOTE(dtantsur): glance images contain a checksum; for file images we # will recalculate the checksum anyway. if (not service_utils.is_glance_image(image_source) |