Fix _usage_from_snapshot in volume.utils

Now in this function we trying to get snapshot_ref.volume for
collecting 'availability_zone'. It's invalid because snapshot_ref
in this function is __dict__. In this patchset there is fix for
it.

Change-Id: I4cb86c0efd7520904fdf2288048d07cc40ed3a13
Closes-bug: #1390064
This commit is contained in:
Ilya Tyaptin
2014-11-06 16:32:33 +04:00
parent b3fd4e1450
commit ad5d20a266
2 changed files with 31 additions and 1 deletions

View File

@@ -120,7 +120,7 @@ def _usage_from_snapshot(context, snapshot_ref, **extra_usage_info):
usage_info = {
'tenant_id': snapshot_ref['project_id'],
'user_id': snapshot_ref['user_id'],
'availability_zone': snapshot_ref.volume['availability_zone'],
'availability_zone': snapshot_ref['volume']['availability_zone'],
'volume_id': snapshot_ref['volume_id'],
'volume_size': snapshot_ref['volume_size'],
'snapshot_id': snapshot_ref['id'],