diff options
Diffstat (limited to 'nova')
-rw-r--r-- | nova/notifications.py | 1 | ||||
-rw-r--r-- | nova/tests/test_notifications.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/nova/notifications.py b/nova/notifications.py index 7153933ee8..036ea2fd95 100644 --- a/nova/notifications.py +++ b/nova/notifications.py @@ -300,6 +300,7 @@ def info_from_instance(context, instance_ref, network_info, instance_id=instance_ref['uuid'], display_name=instance_ref['display_name'], reservation_id=instance_ref['reservation_id'], + hostname=instance_ref['hostname'], # Type properties instance_type=instance_type_name, diff --git a/nova/tests/test_notifications.py b/nova/tests/test_notifications.py index 5abe514863..4bc7820260 100644 --- a/nova/tests/test_notifications.py +++ b/nova/tests/test_notifications.py @@ -82,6 +82,7 @@ class NotificationsTestCase(test.TestCase): inst['access_ip_v4'] = '1.2.3.4' inst['access_ip_v6'] = 'feed:5eed' inst['display_name'] = 'test_instance' + inst['hostname'] = 'test_instance_hostname' if params: inst.update(params) return db.instance_create(self.context, inst) @@ -211,6 +212,7 @@ class NotificationsTestCase(test.TestCase): access_ip_v4 = self.instance["access_ip_v4"] access_ip_v6 = self.instance["access_ip_v6"] display_name = self.instance["display_name"] + hostname = self.instance["hostname"] self.assertEquals(vm_states.BUILDING, payload["old_state"]) self.assertEquals(vm_states.ACTIVE, payload["state"]) @@ -219,6 +221,7 @@ class NotificationsTestCase(test.TestCase): self.assertEquals(payload["access_ip_v4"], access_ip_v4) self.assertEquals(payload["access_ip_v6"], access_ip_v6) self.assertEquals(payload["display_name"], display_name) + self.assertEquals(payload["hostname"], hostname) def test_task_update_with_states(self): self.flags(notify_on_state_change="vm_and_task_state") @@ -232,6 +235,7 @@ class NotificationsTestCase(test.TestCase): access_ip_v4 = self.instance["access_ip_v4"] access_ip_v6 = self.instance["access_ip_v6"] display_name = self.instance["display_name"] + hostname = self.instance["hostname"] self.assertEquals(vm_states.BUILDING, payload["old_state"]) self.assertEquals(vm_states.BUILDING, payload["state"]) @@ -240,6 +244,7 @@ class NotificationsTestCase(test.TestCase): self.assertEquals(payload["access_ip_v4"], access_ip_v4) self.assertEquals(payload["access_ip_v6"], access_ip_v6) self.assertEquals(payload["display_name"], display_name) + self.assertEquals(payload["hostname"], hostname) def test_update_no_service_name(self): notifications.send_update_with_states(self.context, self.instance, |