From 469bf6a6479ba1a90a12d921e292df4c09429a19 Mon Sep 17 00:00:00 2001 From: jiansong Date: Tue, 23 Aug 2016 20:53:47 -0700 Subject: [PATCH] Display flavor-ephemeral in trove flavor-list command This commit adds ephemeral column to flavor-list Change-Id: I537bc2f3578e1e99b22f701f70ab8d96fec8908e Closes-Bug:1617980 --- .../samples/db-flavors-by-id-response-json-http.txt | 2 +- .../source/samples/db-flavors-by-id-response.json | 1 + .../samples/db-flavors-response-json-http.txt | 2 +- api-ref/source/samples/db-flavors-response.json | 13 +++++++++++++ .../flavor-list-ephemeral-edf2dc35d5c247b3.yaml | 4 ++++ trove/flavor/views.py | 1 + trove/tests/api/flavors.py | 4 ++-- 7 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/flavor-list-ephemeral-edf2dc35d5c247b3.yaml diff --git a/api-ref/source/samples/db-flavors-by-id-response-json-http.txt b/api-ref/source/samples/db-flavors-by-id-response-json-http.txt index 3137516acf..a92f8a24c9 100644 --- a/api-ref/source/samples/db-flavors-by-id-response-json-http.txt +++ b/api-ref/source/samples/db-flavors-by-id-response-json-http.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 238 +Content-Length: 254 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/api-ref/source/samples/db-flavors-by-id-response.json b/api-ref/source/samples/db-flavors-by-id-response.json index 6c17ccaea0..56713977db 100644 --- a/api-ref/source/samples/db-flavors-by-id-response.json +++ b/api-ref/source/samples/db-flavors-by-id-response.json @@ -1,5 +1,6 @@ { "flavor": { + "ephemeral": 0, "id": 1, "links": [ { diff --git a/api-ref/source/samples/db-flavors-response-json-http.txt b/api-ref/source/samples/db-flavors-response-json-http.txt index af739601b9..101f6aef34 100644 --- a/api-ref/source/samples/db-flavors-response-json-http.txt +++ b/api-ref/source/samples/db-flavors-response-json-http.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 3050 +Content-Length: 3258 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/api-ref/source/samples/db-flavors-response.json b/api-ref/source/samples/db-flavors-response.json index 623368b516..b237c3bedf 100644 --- a/api-ref/source/samples/db-flavors-response.json +++ b/api-ref/source/samples/db-flavors-response.json @@ -1,6 +1,7 @@ { "flavors": [ { + "ephemeral": 0, "id": 1, "links": [ { @@ -19,6 +20,7 @@ "disk":0 }, { + "ephemeral": 0, "id": 2, "links": [ { @@ -37,6 +39,7 @@ "disk":20 }, { + "ephemeral": 0, "id": 3, "links": [ { @@ -55,6 +58,7 @@ "disk":40 }, { + "ephemeral": 0, "id": 4, "links": [ { @@ -73,6 +77,7 @@ "disk":80 }, { + "ephemeral": 0, "id": 5, "links": [ { @@ -91,6 +96,7 @@ "disk":160 }, { + "ephemeral": 0, "id": 6, "links": [ { @@ -109,6 +115,7 @@ "disk":0 }, { + "ephemeral": 0, "id": 7, "links": [ { @@ -127,6 +134,7 @@ "disk":0 }, { + "ephemeral": 0, "id": 8, "links": [ { @@ -145,6 +153,7 @@ "disk":2 }, { + "ephemeral": 0, "id": 9, "links": [ { @@ -163,6 +172,7 @@ "disk":10 }, { + "ephemeral": 0, "id": 10, "links": [ { @@ -181,6 +191,7 @@ "disk":2 }, { + "ephemeral": 1, "id": 11, "links": [ { @@ -199,6 +210,7 @@ "disk":0 }, { + "ephemeral": 2, "id": 12, "links": [ { @@ -217,6 +229,7 @@ "disk":20 }, { + "ephemeral": 1, "id": null, "links": [ { diff --git a/releasenotes/notes/flavor-list-ephemeral-edf2dc35d5c247b3.yaml b/releasenotes/notes/flavor-list-ephemeral-edf2dc35d5c247b3.yaml new file mode 100644 index 0000000000..22a74bdeee --- /dev/null +++ b/releasenotes/notes/flavor-list-ephemeral-edf2dc35d5c247b3.yaml @@ -0,0 +1,4 @@ +--- +other: + - Add ephemeral column in flavor-list (Bug 1617980) + diff --git a/trove/flavor/views.py b/trove/flavor/views.py index 7f4386b172..ada7302b0b 100644 --- a/trove/flavor/views.py +++ b/trove/flavor/views.py @@ -44,6 +44,7 @@ class FlavorView(object): 'ram': self.flavor.ram, 'vcpus': self.flavor.vcpus, 'disk': self.flavor.disk, + 'ephemeral': self.flavor.ephemeral, 'str_id': str(self.flavor.id), } diff --git a/trove/tests/api/flavors.py b/trove/tests/api/flavors.py index fa57c058f2..f188684844 100644 --- a/trove/tests/api/flavors.py +++ b/trove/tests/api/flavors.py @@ -145,7 +145,7 @@ class Flavors(object): @test def test_flavor_list_attrs(self): allowed_attrs = ['id', 'name', 'ram', 'vcpus', 'disk', 'links', - 'local_storage', 'str_id'] + 'ephemeral', 'local_storage', 'str_id'] flavors = self.rd_client.flavors.list() attrcheck = AttrCheck() for flavor in flavors: @@ -158,7 +158,7 @@ class Flavors(object): @test def test_flavor_get_attrs(self): allowed_attrs = ['id', 'name', 'ram', 'vcpus', 'disk', 'links', - 'local_storage', 'str_id'] + 'ephemeral', 'local_storage', 'str_id'] flavor = self.rd_client.flavors.get(1) attrcheck = AttrCheck() flavor_dict = flavor._info