Add vCPUs to flavor-list

This commit adds vCPU colmn to flavor-list

Closes-Bug: #1261876
Change-Id: I2309d00fb8b1c428a8708d8dd934ccc462fb9366
This commit is contained in:
Masaki Matsushita 2016-07-05 16:37:43 +09:00
parent ff49045744
commit 1a1deafcbf
7 changed files with 38 additions and 20 deletions

View File

@ -1,5 +1,5 @@
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Content-Length: 214 Content-Length: 227
Date: Mon, 18 Mar 2013 19:09:17 GMT Date: Mon, 18 Mar 2013 19:09:17 GMT

View File

@ -13,6 +13,7 @@
], ],
"name": "m1.tiny", "name": "m1.tiny",
"ram": 512, "ram": 512,
"str_id": "1" "str_id": "1",
"vcpus": 10
} }
} }

View File

@ -1,5 +1,5 @@
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Content-Length: 2730 Content-Length: 2899
Date: Mon, 18 Mar 2013 19:09:17 GMT Date: Mon, 18 Mar 2013 19:09:17 GMT

View File

@ -14,7 +14,8 @@
], ],
"name": "m1.tiny", "name": "m1.tiny",
"ram": 512, "ram": 512,
"str_id": "1" "str_id": "1",
"vcpus": 10
}, },
{ {
"id": 2, "id": 2,
@ -30,7 +31,8 @@
], ],
"name": "m1.small", "name": "m1.small",
"ram": 2048, "ram": 2048,
"str_id": "2" "str_id": "2",
"vcpus": 10
}, },
{ {
"id": 3, "id": 3,
@ -46,7 +48,8 @@
], ],
"name": "m1.medium", "name": "m1.medium",
"ram": 4096, "ram": 4096,
"str_id": "3" "str_id": "3",
"vcpus": 10
}, },
{ {
"id": 4, "id": 4,
@ -62,7 +65,8 @@
], ],
"name": "m1.large", "name": "m1.large",
"ram": 8192, "ram": 8192,
"str_id": "4" "str_id": "4",
"vcpus": 10
}, },
{ {
"id": 5, "id": 5,
@ -78,7 +82,8 @@
], ],
"name": "m1.xlarge", "name": "m1.xlarge",
"ram": 16384, "ram": 16384,
"str_id": "5" "str_id": "5",
"vcpus": 10
}, },
{ {
"id": 6, "id": 6,
@ -94,7 +99,8 @@
], ],
"name": "m1.nano", "name": "m1.nano",
"ram": 64, "ram": 64,
"str_id": "6" "str_id": "6",
"vcpus": 10
}, },
{ {
"id": 7, "id": 7,
@ -110,7 +116,8 @@
], ],
"name": "m1.micro", "name": "m1.micro",
"ram": 128, "ram": 128,
"str_id": "7" "str_id": "7",
"vcpus": 10
}, },
{ {
"id": 8, "id": 8,
@ -126,7 +133,8 @@
], ],
"name": "m1.rd-smaller", "name": "m1.rd-smaller",
"ram": 768, "ram": 768,
"str_id": "8" "str_id": "8",
"vcpus": 10
}, },
{ {
"id": 9, "id": 9,
@ -142,7 +150,8 @@
], ],
"name": "tinier", "name": "tinier",
"ram": 506, "ram": 506,
"str_id": "9" "str_id": "9",
"vcpus": 10
}, },
{ {
"id": 10, "id": 10,
@ -158,7 +167,8 @@
], ],
"name": "m1.rd-tiny", "name": "m1.rd-tiny",
"ram": 512, "ram": 512,
"str_id": "10" "str_id": "10",
"vcpus": 10
}, },
{ {
"id": 11, "id": 11,
@ -174,7 +184,8 @@
], ],
"name": "eph.rd-tiny", "name": "eph.rd-tiny",
"ram": 512, "ram": 512,
"str_id": "11" "str_id": "11",
"vcpus": 10
}, },
{ {
"id": 12, "id": 12,
@ -190,7 +201,8 @@
], ],
"name": "eph.rd-smaller", "name": "eph.rd-smaller",
"ram": 768, "ram": 768,
"str_id": "12" "str_id": "12",
"vcpus": 10
}, },
{ {
"id": null, "id": null,
@ -206,7 +218,8 @@
], ],
"name": "custom.small", "name": "custom.small",
"ram": 512, "ram": 512,
"str_id": "custom" "str_id": "custom",
"vcpus": 10
} }
] ]
} }

View File

@ -0,0 +1,3 @@
---
other:
- Add vCPUs column in flavor-list Bug 1261876.

View File

@ -40,6 +40,7 @@ class FlavorView(object):
'links': self._build_links(), 'links': self._build_links(),
'name': self.flavor.name, 'name': self.flavor.name,
'ram': self.flavor.ram, 'ram': self.flavor.ram,
'vcpus': self.flavor.vcpus,
'str_id': str(self.flavor.id), 'str_id': str(self.flavor.id),
} }

View File

@ -146,8 +146,8 @@ class Flavors(object):
@test @test
def test_flavor_list_attrs(self): def test_flavor_list_attrs(self):
allowed_attrs = ['id', 'name', 'ram', 'links', 'local_storage', allowed_attrs = ['id', 'name', 'ram', 'vcpus', 'links',
'str_id'] 'local_storage', 'str_id']
flavors = self.rd_client.flavors.list() flavors = self.rd_client.flavors.list()
attrcheck = AttrCheck() attrcheck = AttrCheck()
for flavor in flavors: for flavor in flavors:
@ -159,8 +159,8 @@ class Flavors(object):
@test @test
def test_flavor_get_attrs(self): def test_flavor_get_attrs(self):
allowed_attrs = ['id', 'name', 'ram', 'links', 'local_storage', allowed_attrs = ['id', 'name', 'ram', 'vcpus', 'links',
'str_id'] 'local_storage', 'str_id']
flavor = self.rd_client.flavors.get(1) flavor = self.rd_client.flavors.get(1)
attrcheck = AttrCheck() attrcheck = AttrCheck()
flavor_dict = flavor._info flavor_dict = flavor._info