Merge "Raise TemporaryFailure if no conductors are online"

This commit is contained in:
Zuul 2018-06-21 10:42:07 +00:00 committed by Gerrit Code Review
commit a38edcebfa
3 changed files with 11 additions and 1 deletions

View File

@ -128,6 +128,10 @@ class ConductorAPI(object):
"""
self.ring_manager.reset()
# There are no conductors, temporary failure - 503 Service Unavailable
if not self.ring_manager.ring:
raise exception.TemporaryFailure()
try:
ring = self.ring_manager[node.driver]
dest = ring.get_nodes(node.uuid.encode('utf-8'),

View File

@ -98,7 +98,7 @@ class RPCAPITestCase(db_base.DbTestCase):
CONF.set_override('host', 'fake-host')
rpcapi = conductor_rpcapi.ConductorAPI(topic='fake-topic')
self.assertRaises(exception.NoValidHost,
self.assertRaises(exception.TemporaryFailure,
rpcapi.get_topic_for,
self.fake_node_obj)

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Ironic API now returns ``503 Service Unavailable`` for action requiring a
conductor when no conductors are online.
`Bug: 2002600 <https://storyboard.openstack.org/#!/story/2002600>`_.