summaryrefslogtreecommitdiff
path: root/nova/exception.py
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2023-02-01 08:27:08 -0800
committerDan Smith <dansmith@redhat.com>2023-02-01 09:23:33 -0800
commitcf33be68713e30b7e4a4ca8dd3c4138329914503 (patch)
treed441b435768cf0a2453a120e1c7fcd12b798fc07 /nova/exception.py
parent5934f85fb9e7d18a05ef7e8a6217697bed753d4f (diff)
downloadnova-cf33be68713e30b7e4a4ca8dd3c4138329914503.tar.gz
Abort startup if nodename conflict is detected
We do run update_available_resource() synchronously during service startup, but we only allow certain exceptions to abort startup. This makes us abort for InvalidConfiguration, and makes the resource tracker raise that for the case where the compute node create failed due to a duplicate entry. This also modifies the object to raise a nova-specific error for that condition to avoid the compute node needing to import oslo_db stuff just to be able to catch it. Change-Id: I5de98e6fe52e45996bc2e1014fa8a09a2de53682
Diffstat (limited to 'nova/exception.py')
-rw-r--r--nova/exception.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py
index 20c112b628..f5993e79f8 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -2512,6 +2512,10 @@ class InvalidNodeConfiguration(NovaException):
msg_fmt = _('Invalid node identity configuration: %(reason)s')
+class DuplicateRecord(NovaException):
+ msg_fmt = _('Unable to create duplicate record for %(target)s')
+
+
class NotSupportedComputeForEvacuateV295(NotSupported):
msg_fmt = _("Starting to microversion 2.95, evacuate API will stop "
"instance on destination. To evacuate before upgrades are "