Skip to content
Permalink
Browse files

Print cell name in cell timeout exceptions

Change-Id: I99fa337bd28142d74772bab63ac73f73f222a056
  • Loading branch information...
sorrison committed Oct 20, 2014
1 parent c4f28a9 commit 60f669ba1ed5221d71138a72fb2cf3b34c07a970
Showing with 5 additions and 4 deletions.
  1. +4 −3 nova/cells/messaging.py
  2. +1 −1 nova/exception.py
@@ -215,7 +215,7 @@ def _cleanup_response_queue(self):
self.msg_runner._cleanup_response_queue(self)
self.resp_queue = None

def _wait_for_json_responses(self, num_responses=1):
def _wait_for_json_responses(self, num_responses=1, cell_name=''):
"""Wait for response(s) to be put into the eventlet queue. Since
each queue entry actually contains a list of JSON-ified responses,
combine them all into a single list to return.
@@ -232,7 +232,7 @@ def _wait_for_json_responses(self, num_responses=1):
json_responses = self.resp_queue.get(timeout=wait_time)
responses.extend(json_responses)
except queue.Empty:
raise exception.CellTimeout()
raise exception.CellTimeout(cell_name=cell_name)
finally:
self._cleanup_response_queue()
return responses
@@ -441,7 +441,8 @@ def process(self):

if wait_for_response:
# Targeted messages only have 1 response.
remote_response = self._wait_for_json_responses()[0]
remote_response = self._wait_for_json_responses(
cell_name=next_hop.name)[0]
return Response.from_json(remote_response)


@@ -1044,7 +1044,7 @@ class CellServiceAPIMethodNotFound(NotFound):


class CellTimeout(NotFound):
msg_fmt = _("Timeout waiting for response from cell")
msg_fmt = _("Timeout waiting for response from cell %(cell_name)s")


class CellMaxHopCountReached(NovaException):

0 comments on commit 60f669b

Please sign in to comment.
You can’t perform that action at this time.