Add serial console url attribute for nova server

Add 'serial' console type for nova server console
url attribute.

Change-Id: I24b3682893035cb9771e60a180e5b98cba1cab39
Closes-Bug: #1399049
This commit is contained in:
huangtianhua 2014-12-04 11:00:57 +08:00
parent a3f8c810b1
commit 06491c706f
4 changed files with 5 additions and 2 deletions

View File

@ -439,6 +439,7 @@ echo -e '%s\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
'xvpvnc': server.get_vnc_console,
'spice-html5': server.get_spice_console,
'rdp-html5': server.get_rdp_console,
'serial': server.get_serial_console
}
def __getitem__(self, key):

View File

@ -356,7 +356,7 @@ class Server(stack_user.StackUser):
"can be specified as parameter to the get_attr function, "
"e.g. get_attr: [ <server>, console_urls, novnc ]. "
"Currently supported types are "
"novnc, xvpvnc, spice-html5, rdp-html5.")
"novnc, xvpvnc, spice-html5, rdp-html5, serial.")
),
}

View File

@ -347,6 +347,7 @@ class ConsoleUrlsTest(common.HeatTestCase):
('xvpvnc', dict(console_type='xvpvnc', srv_method='vnc')),
('spice', dict(console_type='spice-html5', srv_method='spice')),
('rdp', dict(console_type='rdp-html5', srv_method='rdp')),
('serial', dict(console_type='serial', srv_method='serial')),
]
def setUp(self):

View File

@ -2165,7 +2165,8 @@ class ServersTest(common.HeatTestCase):
console_urls = ws._resolve_attribute('console_urls')
self.assertIsInstance(console_urls, collections.Mapping)
supported_consoles = ('novnc', 'xvpvnc', 'spice-html5', 'rdp-html5')
supported_consoles = ('novnc', 'xvpvnc', 'spice-html5', 'rdp-html5',
'serial')
self.assertEqual(set(supported_consoles), set(console_urls.keys()))
self.m.VerifyAll()