mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-14 05:22:02 +00:00
Flavor properties are not deleted on changes and id will stay
Fixing a bug on compute_falvor that causes that extra_specs are deleted and the id is changing when a property of the falvor is changed. Changing the id will cause that a server which is using the falvor is afterwards not assigned to the falvor anymore. Story: 2009260 Change-Id: If7cbce107ce99de79749359e257933e4247e3634
This commit is contained in:
@@ -220,9 +220,12 @@ class ComputeFlavorModule(OpenStackModule):
|
|||||||
if self.params[param_key] != flavor[param_key]:
|
if self.params[param_key] != flavor[param_key]:
|
||||||
require_update = True
|
require_update = True
|
||||||
break
|
break
|
||||||
|
flavorid = self.params['flavorid']
|
||||||
if flavor and require_update:
|
if flavor and require_update:
|
||||||
self.conn.delete_flavor(name)
|
self.conn.delete_flavor(name)
|
||||||
|
old_extra_specs = {}
|
||||||
|
if flavorid == 'auto':
|
||||||
|
flavorid = flavor['id']
|
||||||
flavor = None
|
flavor = None
|
||||||
|
|
||||||
if not flavor:
|
if not flavor:
|
||||||
@@ -231,7 +234,7 @@ class ComputeFlavorModule(OpenStackModule):
|
|||||||
ram=self.params['ram'],
|
ram=self.params['ram'],
|
||||||
vcpus=self.params['vcpus'],
|
vcpus=self.params['vcpus'],
|
||||||
disk=self.params['disk'],
|
disk=self.params['disk'],
|
||||||
flavorid=self.params['flavorid'],
|
flavorid=flavorid,
|
||||||
ephemeral=self.params['ephemeral'],
|
ephemeral=self.params['ephemeral'],
|
||||||
swap=self.params['swap'],
|
swap=self.params['swap'],
|
||||||
rxtx_factor=self.params['rxtx_factor'],
|
rxtx_factor=self.params['rxtx_factor'],
|
||||||
|
|||||||
Reference in New Issue
Block a user