From 6767b7e5d52798a9177bb16d2a9726fc73c047dc Mon Sep 17 00:00:00 2001 From: yehia-beyh Date: Wed, 23 Jul 2014 14:39:38 -0400 Subject: [PATCH] Add storageHost content to volume messages. Implements: Volume notification Storage Host entry in the payload Closes-Bug: 1333273 Change-Id: I370eaeaafd8fd4a8888f8250b49dffcbffb3a876 --- cinder/tests/test_volume.py | 1 + cinder/volume/utils.py | 1 + 2 files changed, 2 insertions(+) diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 57851d4ec..c72178dc0 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -343,6 +343,7 @@ class VolumeTestCase(BaseVolumeTestCase): self.assertEqual(msg['event_type'], 'volume.create.start') expected = { 'status': 'creating', + 'host': socket.gethostname(), 'display_name': 'test_volume', 'availability_zone': 'nova', 'tenant_id': 'fake', diff --git a/cinder/volume/utils.py b/cinder/volume/utils.py index cb4c40de5..f423a4164 100644 --- a/cinder/volume/utils.py +++ b/cinder/volume/utils.py @@ -41,6 +41,7 @@ def null_safe_str(s): def _usage_from_volume(context, volume_ref, **kw): usage_info = dict(tenant_id=volume_ref['project_id'], + host=volume_ref['host'], user_id=volume_ref['user_id'], instance_uuid=volume_ref['instance_uuid'], availability_zone=volume_ref['availability_zone'], -- 2.45.2