Browse Source

Don't copy the flavorid when updating flavors

The Nova API makes the implicit assumption that flavorids are unique,
so if one creates two flavors with the same flavorid, subsequent
requests for flavor information can vary between "inaccurate" and
"wildly f*cking inaccurate"

From an end-user perspective, it makes it look like data such as
flavor access settings get lost between edits (because the API pulls
the access list from the wrong flavor)

Let the API assign a new flavorid on changes.  The comments around
the handler code imply that is the desired behaviour, anyhow.

Cherry-picked from 4100a1cbc2

Change-Id: I5403202396a7b136b0ae8637d6aae1cf32550747
Closes-Bug: 1276371
tags/2013.2.3
Nicolas Simonds 6 years ago
parent
commit
b2259b352f
2 changed files with 0 additions and 5 deletions
  1. +0
    -4
      openstack_dashboard/dashboards/admin/flavors/tests.py
  2. +0
    -1
      openstack_dashboard/dashboards/admin/flavors/workflows.py

+ 0
- 4
openstack_dashboard/dashboards/admin/flavors/tests.py View File

@@ -348,7 +348,6 @@ class UpdateFlavorWorkflowTests(BaseFlavorWorkflowTests):
new_flavor.disk,
swap=new_flavor.swap,
ephemeral=eph,
flavorid=flavor.id,
is_public=True).AndReturn(new_flavor)

# Put mocks in replay mode
@@ -418,7 +417,6 @@ class UpdateFlavorWorkflowTests(BaseFlavorWorkflowTests):
new_flavor.disk,
swap=new_flavor.swap,
ephemeral=eph,
flavorid=flavor.id,
is_public=True).AndReturn(new_flavor)
api.nova.flavor_extra_set(IsA(http.HttpRequest),
new_flavor.id, extra_specs)
@@ -490,7 +488,6 @@ class UpdateFlavorWorkflowTests(BaseFlavorWorkflowTests):
new_flavor.disk,
swap=new_flavor.swap,
ephemeral=eph,
flavorid=flavor.id,
is_public=True)\
.AndRaise(self.exceptions.nova)

@@ -566,7 +563,6 @@ class UpdateFlavorWorkflowTests(BaseFlavorWorkflowTests):
new_flavor.disk,
swap=new_flavor.swap,
ephemeral=eph,
flavorid=flavor.id,
is_public=new_flavor.is_public) \
.AndReturn(new_flavor)



+ 0
- 1
openstack_dashboard/dashboards/admin/flavors/workflows.py View File

@@ -292,7 +292,6 @@ class UpdateFlavor(workflows.Workflow):
data['disk_gb'],
ephemeral=data['eph_gb'],
swap=data['swap_mb'],
flavorid=flavor_id,
is_public=is_public)
if (extras_dict):
api.nova.flavor_extra_set(request, flavor.id, extras_dict)


Loading…
Cancel
Save