Commit d75eeac4 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Remove 'Ref' suffix from servers API

Rename 'flavorRef' to 'flavor' and 'imageRef' to 'image', to responses of
/servers API. 'flavorRef' and 'imageRef' are still preserved to to request
parameters of POST /servers.

Refs #3768
parent 4f9e4cb2
......@@ -133,8 +133,8 @@ def vm_to_dict(vm, detail=False):
d['hostId'] = vm.hostid
d['updated'] = utils.isoformat(vm.updated)
d['created'] = utils.isoformat(vm.created)
d['flavorRef'] = vm.flavor.id
d['imageRef'] = vm.imageid
d['flavor'] = vm.flavor.id
d['image'] = vm.imageid
d['suspended'] = vm.suspended
metadata = dict((m.meta_key, m.meta_value) for m in vm.metadata.all())
......
......@@ -78,10 +78,10 @@ class ServerAPITest(BaseAPITest):
self.assertEqual(len(servers), len(user_vms))
for api_vm in servers:
db_vm = user_vms[api_vm['id']]
self.assertEqual(api_vm['flavorRef'], db_vm.flavor.id)
self.assertEqual(api_vm['flavor'], db_vm.flavor.id)
self.assertEqual(api_vm['hostId'], db_vm.hostid)
self.assertEqual(api_vm['id'], db_vm.id)
self.assertEqual(api_vm['imageRef'], db_vm.imageid)
self.assertEqual(api_vm['image'], db_vm.imageid)
self.assertEqual(api_vm['name'], db_vm.name)
self.assertEqual(api_vm['status'], get_rsapi_state(db_vm))
self.assertSuccess(response)
......@@ -98,10 +98,10 @@ class ServerAPITest(BaseAPITest):
response = self.get('/api/v1.1/servers/%d' % db_vm.id, user)
server = json.loads(response.content)['server']
self.assertEqual(server['flavorRef'], db_vm.flavor.id)
self.assertEqual(server['flavor'], db_vm.flavor.id)
self.assertEqual(server['hostId'], db_vm.hostid)
self.assertEqual(server['id'], db_vm.id)
self.assertEqual(server['imageRef'], db_vm.imageid)
self.assertEqual(server['image'], db_vm.imageid)
self.assertEqual(server['name'], db_vm.name)
self.assertEqual(server['status'], get_rsapi_state(db_vm))
api_nic = server['attachments']['values'][0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment