Adding extra_specs to flavor format
We have added a new API extension FlavorWithExtraSpecs which when
enabled, will add the extra_specs of a flavor to the flavor
show and detail calls.
This handles the extra_specs field while parsing the flavor response
in the _format_flavor method.
Implements blueprint add-extra-specs-to-flavor-format
Change-Id: I46faaab69381c07b4c1466188a9c23014d869418
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index a6451df..2de20f1 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -30,6 +30,8 @@
"http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1"
XMLNS_OS_FLV_ACCESS = \
"http://docs.openstack.org/compute/ext/flavor_access/api/v1.1"
+XMLNS_OS_FLV_WITH_EXT_SPECS = \
+ "http://docs.openstack.org/compute/ext/flavor_with_extra_specs/api/v2.0"
class FlavorsClientXML(RestClientXML):
@@ -49,6 +51,11 @@
if k == '{%s}ephemeral' % XMLNS_OS_FLV_EXT_DATA:
k = 'OS-FLV-EXT-DATA:ephemeral'
+ if k == '{%s}extra_specs' % XMLNS_OS_FLV_WITH_EXT_SPECS:
+ k = 'OS-FLV-WITH-EXT-SPECS:extra_specs'
+ flavor[k] = dict(v)
+ continue
+
try:
v = int(v)
except ValueError: