Browse Source

Support microversion 2.61 for nova flavors

2.61 adds extra_specs, which is a nice to have.

Change-Id: I43e88fee9ff41ed1eede4199dcab0910d19a51f7
Monty Taylor 1 week ago
parent
commit
842d3caab7
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      openstack/compute/v2/flavor.py

+ 7
- 0
openstack/compute/v2/flavor.py View File

@@ -29,6 +29,9 @@ class Flavor(resource.Resource):
29 29
         min_disk="minDisk",
30 30
         min_ram="minRam")
31 31
 
32
+    # extra_specs introduced in 2.61
33
+    _max_microversion = '2.61'
34
+
32 35
     # Properties
33 36
     #: Links pertaining to this flavor. This is a list of dictionaries,
34 37
     #: each including keys ``href`` and ``rel``.
@@ -54,6 +57,10 @@ class Flavor(resource.Resource):
54 57
     is_disabled = resource.Body('OS-FLV-DISABLED:disabled', type=bool)
55 58
     #: The bandwidth scaling factor this flavor receives on the network.
56 59
     rxtx_factor = resource.Body('rxtx_factor', type=float)
60
+    # TODO(mordred) extra_specs can historically also come from
61
+    #               OS-FLV-WITH-EXT-SPECS:extra_specs. Do we care?
62
+    #: A dictionary of the flavor's extra-specs key-and-value pairs.
63
+    extra_specs = resource.Body('extra_specs', type=dict)
57 64
 
58 65
 
59 66
 class FlavorDetail(Flavor):

Loading…
Cancel
Save