diff options
| author | Sandy Walsh <sandy@sandywalsh.com> | 2012-01-04 13:05:36 -0800 |
|---|---|---|
| committer | Sandy Walsh <sandy@sandywalsh.com> | 2012-01-04 13:08:47 -0800 |
| commit | 5ff9619f3989d7baec00eb397d265439d6e87d9c (patch) | |
| tree | 5f55a249c1c6f68b4fa5d93ac52c438162e49951 | |
| parent | 27293b7f4044cdca4da3f7752dd9399fb182b895 (diff) | |
| download | nova-5ff9619f3989d7baec00eb397d265439d6e87d9c.tar.gz nova-5ff9619f3989d7baec00eb397d265439d6e87d9c.tar.xz nova-5ff9619f3989d7baec00eb397d265439d6e87d9c.zip | |
Add instance_name field to console detail command
which will give the caller the necessary information to actually
connect.
Change-Id: Id4774afb28e4d8595ea118867b97c61e5e73b9a5
| -rw-r--r-- | nova/api/openstack/v2/consoles.py | 1 | ||||
| -rw-r--r-- | nova/tests/api/openstack/v2/test_consoles.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/nova/api/openstack/v2/consoles.py b/nova/api/openstack/v2/consoles.py index ad0d8cbb4..1c832f316 100644 --- a/nova/api/openstack/v2/consoles.py +++ b/nova/api/openstack/v2/consoles.py @@ -39,6 +39,7 @@ def _translate_detail_keys(cons): info = {'id': cons['id'], 'console_type': pool['console_type'], 'password': cons['password'], + 'instance_name': cons['instance_name'], 'port': cons['port'], 'host': pool['public_hostname']} return dict(console=info) diff --git a/nova/tests/api/openstack/v2/test_consoles.py b/nova/tests/api/openstack/v2/test_consoles.py index 2b7f89149..801dab767 100644 --- a/nova/tests/api/openstack/v2/test_consoles.py +++ b/nova/tests/api/openstack/v2/test_consoles.py @@ -155,12 +155,13 @@ class ConsolesControllerTest(test.TestCase): pool = dict(console_type='fake_type', public_hostname='fake_hostname') return dict(id=console_id, password='fake_password', - port='fake_port', pool=pool) + port='fake_port', pool=pool, instance_name='inst-0001') expected = {'console': {'id': 20, 'port': 'fake_port', 'host': 'fake_hostname', 'password': 'fake_password', + 'instance_name': 'inst-0001', 'console_type': 'fake_type'}} self.stubs.Set(console.API, 'get_console', fake_get_console) |
