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. Change-Id: I5403202396a7b136b0ae8637d6aae1cf32550747 Closes-Bug: 1276371
This commit is contained in:
parent
60b6f6b35c
commit
4100a1cbc2
|
@ -360,7 +360,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
|
||||
|
@ -430,7 +429,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)
|
||||
|
@ -502,7 +500,6 @@ class UpdateFlavorWorkflowTests(BaseFlavorWorkflowTests):
|
|||
new_flavor.disk,
|
||||
swap=new_flavor.swap,
|
||||
ephemeral=eph,
|
||||
flavorid=flavor.id,
|
||||
is_public=True)\
|
||||
.AndRaise(self.exceptions.nova)
|
||||
|
||||
|
@ -578,7 +575,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)
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue