Fix 'os-interface' resource name for Nova V2.1

V2 and V3 diff for this resource name is below-
V2 - '/servers/os-interface'
V3 - '/servers/os-attach-interfaces'

V3 resource name needs to be changed to work that for V2.1

Change-Id: I37bd7cee7e8879b01a8aee739d74c2dd6e033dc4
Closes-Bug: #1368035
This commit is contained in:
Ghanshyam 2014-09-11 14:56:36 +09:00
parent f6340ea106
commit f7ef2b09a1
2 changed files with 5 additions and 5 deletions

View File

@ -188,7 +188,7 @@ class AttachInterfaces(extensions.V3APIExtensionBase):
version = 1
def get_resources(self):
res = [extensions.ResourceExtension(ALIAS,
res = [extensions.ResourceExtension('os-interface',
InterfaceAttachmentController(),
parent=dict(
member_name='server',

View File

@ -103,7 +103,7 @@ class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase):
def test_list_interfaces(self):
instance_uuid = self._post_server()
response = self._do_get('servers/%s/os-attach-interfaces'
response = self._do_get('servers/%s/os-interface'
% instance_uuid)
subs = {
'ip_address': '192.168.1.3',
@ -125,7 +125,7 @@ class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase):
instance_uuid = self._post_server()
port_id = 'ce531f90-199f-48c0-816c-13e38010b442'
self._stub_show_for_instance(instance_uuid, port_id)
response = self._do_get('servers/%s/os-attach-interfaces/%s' %
response = self._do_get('servers/%s/os-interface/%s' %
(instance_uuid, port_id))
subs = {
'ip_address': '192.168.1.3',
@ -150,7 +150,7 @@ class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase):
'mac_addr': 'fa:16:3e:4c:2c:30',
}
self._stub_show_for_instance(instance_uuid, subs['port_id'])
response = self._do_post('servers/%s/os-attach-interfaces'
response = self._do_post('servers/%s/os-interface'
% instance_uuid,
'attach-interfaces-create-req', subs)
subs.update(self._get_regexes())
@ -160,7 +160,7 @@ class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase):
def test_delete_interfaces(self):
instance_uuid = self._post_server()
port_id = 'ce531f90-199f-48c0-816c-13e38010b442'
response = self._do_delete('servers/%s/os-attach-interfaces/%s' %
response = self._do_delete('servers/%s/os-interface/%s' %
(instance_uuid, port_id))
self.assertEqual(response.status, 202)
self.assertEqual(response.read(), '')