diff options
author | Dmitry Tantsur <dtantsur@protonmail.com> | 2021-01-08 17:57:56 +0100 |
---|---|---|
committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2021-01-19 17:56:06 +0100 |
commit | b6f4587f0bdfc2f4b5736db1c9f89639ef2e09a7 (patch) | |
tree | fb537867eded3c171686df7ca5b5cd41d00fff5e /ironic/drivers/base.py | |
parent | d35eb8bd0e401f659fa4190ea875251ff841a345 (diff) | |
download | ironic-b6f4587f0bdfc2f4b5736db1c9f89639ef2e09a7.tar.gz |
Common framework for configuring secure boot
Two drivers already support turning secore boot on and off,
Redfish will follow soon. This patch adds ManagementInterface
calls to get and set the secure boot state.
Story: #2008270
Task: #41561
Change-Id: I96b2697163def52618b4c051a5c85adf7d1818a5
Diffstat (limited to 'ironic/drivers/base.py')
-rw-r--r-- | ironic/drivers/base.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index baf5a5579..7d137f9c4 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -972,6 +972,40 @@ class ManagementInterface(BaseInterface): raise exception.UnsupportedDriverExtension( driver=task.node.driver, extension='get_boot_mode') + def get_secure_boot_state(self, task): + """Get the current secure boot state for the node. + + NOTE: Not all drivers support this method. Older hardware + may not implement that. + + :param task: A task from TaskManager. + :raises: MissingParameterValue if a required parameter is missing + :raises: DriverOperationError or its derivative in case + of driver runtime error. + :raises: UnsupportedDriverExtension if secure boot is + not supported by the driver or the hardware + :returns: Boolean + """ + raise exception.UnsupportedDriverExtension( + driver=task.node.driver, extension='get_secure_boot_state') + + def set_secure_boot_state(self, task, state): + """Set the current secure boot state for the node. + + NOTE: Not all drivers support this method. Older hardware + may not implement that. + + :param task: A task from TaskManager. + :param state: A new state as a boolean. + :raises: MissingParameterValue if a required parameter is missing + :raises: DriverOperationError or its derivative in case + of driver runtime error. + :raises: UnsupportedDriverExtension if secure boot is + not supported by the driver or the hardware + """ + raise exception.UnsupportedDriverExtension( + driver=task.node.driver, extension='set_secure_boot_state') + @abc.abstractmethod def get_sensors_data(self, task): """Get sensors data method. |