diff --git a/orm/services/flavor_manager/fms_rest/data/wsme/models.py b/orm/services/flavor_manager/fms_rest/data/wsme/models.py index e21a1812..e4e51503 100755 --- a/orm/services/flavor_manager/fms_rest/data/wsme/models.py +++ b/orm/services/flavor_manager/fms_rest/data/wsme/models.py @@ -491,6 +491,10 @@ class Flavor(Model): self.options[n].lower() == 'true'] if option_pci: + es = db_models.FlavorExtraSpec( + key_name_value=series_metadata[ + 'es_pci_numa_affinity_policy']) + extra_spec_needed.append(es) requested_options.extend(option_pci) # Evaluate thread options diff --git a/orm/services/flavor_manager/fms_rest/logic/flavor_logic.py b/orm/services/flavor_manager/fms_rest/logic/flavor_logic.py index da4c6768..f0e6c1c2 100755 --- a/orm/services/flavor_manager/fms_rest/logic/flavor_logic.py +++ b/orm/services/flavor_manager/fms_rest/logic/flavor_logic.py @@ -504,7 +504,7 @@ def delete_extra_specs(flavor_id, transaction_id, extra_spec=None): flavor_id)) existing_region_names = sql_flavor.get_existing_region_names() - # calculate default flavor extra + # calculate default and options extra specs flavor_wrapper = FlavorWrapper.from_db_model(sql_flavor) default_extra_specs = flavor_wrapper.get_extra_spec_needed() # check if delete all or one @@ -512,8 +512,8 @@ def delete_extra_specs(flavor_id, transaction_id, extra_spec=None): if not extra_spec_in_default(extra_spec, default_extra_specs): sql_flavor.remove_extra_spec(extra_spec) else: - raise ErrorStatus(400, - "Bad request, this key cannot be deleted") + raise ErrorStatus( + 400, "Deletion not allowed for {0}".format(extra_spec)) else: sql_flavor.delete_all_extra_specs() sql_flavor.add_extra_specs(default_extra_specs) @@ -945,7 +945,7 @@ def calculate_name(flavor): - flavor options (OPTIONAL) Following is a sample flavor name: - name = xx.c1r1d1s4e5.i2n0 + name = xx.c1r1d1s4e5.n0i2 where xx : flavor series name c1 : number of cores (or cpu); sample shows vcpu = 1 @@ -985,8 +985,6 @@ def calculate_name(flavor): list(flavor.flavor.options.keys()) and flavor.flavor.options[n].lower() == 'true'] - if 'i2' in options and 'n0' not in options: - options.remove('i2') if 't0' in options and flavor.flavor.visibility.lower() != 'private': options.remove('t0')