From 6af6d10ab31fa108316b3909b404cbe6a2942081 Mon Sep 17 00:00:00 2001 From: LALLAU Bertrand Date: Tue, 5 Nov 2024 15:38:42 +0100 Subject: [PATCH] Instance provisioning fails on SQLite The following error occurs when using SQLite: oslo_config.cfg.NoSuchOptError: no such option hostname in group [DEFAULT] `hostname` is not defined in [DEFAULT] group, use `host` instead. Closes-Bug: #2086682 Change-Id: Ic93b5d7c6ea27a3c47daa6b2c6671aaa401b5427 --- ironic/db/sqlalchemy/api.py | 2 +- releasenotes/notes/fix-sqlite-lock-61232cfe81adbde4.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-sqlite-lock-61232cfe81adbde4.yaml diff --git a/ironic/db/sqlalchemy/api.py b/ironic/db/sqlalchemy/api.py index 34896be037..6375790f7d 100644 --- a/ironic/db/sqlalchemy/api.py +++ b/ironic/db/sqlalchemy/api.py @@ -742,7 +742,7 @@ class Connection(api.Connection): # Nothing updated and node exists. Must already be # locked. Identify who holds it and log. if utils.is_ironic_using_sqlite(): - lock_holder = CONF.hostname + lock_holder = CONF.host else: lock_holder = self._get_node_reservation(node.id).reservation raise exception.NodeLocked(node=node.uuid, host=lock_holder) diff --git a/releasenotes/notes/fix-sqlite-lock-61232cfe81adbde4.yaml b/releasenotes/notes/fix-sqlite-lock-61232cfe81adbde4.yaml new file mode 100644 index 0000000000..080804b761 --- /dev/null +++ b/releasenotes/notes/fix-sqlite-lock-61232cfe81adbde4.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fix issue on SQLite database usage. Previously ironic node provisioning may + fail with error related accessing the hostname. + For more details please see + `bug 2086682 `_.