Make consistency group timeout exception message more robust

In case the CG name is None, use the ID instead so we have
context on the failure.

Also, add the current CG status to the timeout message.

Change-Id: Ifb579d319f4230a662a218f479070a420d7ba38e
Closes-Bug: #1547056
This commit is contained in:
Matt Riedemann 2016-02-18 07:14:02 -08:00
parent f13e5ab039
commit b2f786396b

View File

@ -725,10 +725,15 @@ class SharesV2Client(shares_client.SharesClient):
consistency_group_id=consistency_group_id)
if int(time.time()) - start >= self.build_timeout:
consistency_group_name = (
consistency_group_name if consistency_group_name else
consistency_group_id
)
message = ('Consistency Group %s failed to reach %s status '
'within the required time (%s s).' %
'within the required time (%s s). '
'Current status: %s' %
(consistency_group_name, status,
self.build_timeout))
self.build_timeout, consistency_group_status))
raise exceptions.TimeoutException(message)
###############