Merge "Removing rx/tx factor from flavors"

This commit is contained in:
Zuul 2025-04-25 15:19:55 +00:00 committed by Gerrit Code Review
commit c7e4095f95
13 changed files with 13 additions and 38 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -61,12 +61,6 @@ Create flavors
**Swap Disk (MB)** Enter the amount of swap space (in
megabytes) to use. If unspecified,
the default is 0.
**RX/TX Factor** Optional property allows servers with
a different bandwidth to be created
with the RX/TX Factor. The default
value is 1. That is, the new bandwidth
is the same as that of the attached
network.
========================= =======================================
#. In the :guilabel:`Flavor Access` tab, you can control access to

View File

@ -107,8 +107,6 @@
"compute_extension:v3:os-flavor-access": "",
"compute_extension:flavor_disabled": "",
"compute_extension:v3:os-flavor-disabled": "",
"compute_extension:flavor_rxtx": "",
"compute_extension:v3:os-flavor-rxtx": "",
"compute_extension:flavor_swap": "",
"compute_extension:flavorextradata": "",
"compute_extension:flavorextraspecs:index": "",

View File

@ -231,14 +231,12 @@ def server_mks_console(request, instance_id):
@profiler.trace
def flavor_create(request, name, memory, vcpu, disk, flavorid='auto',
ephemeral=0, swap=0, metadata=None, is_public=True,
rxtx_factor=1):
ephemeral=0, swap=0, metadata=None, is_public=True):
flavor = _nova.novaclient(request).flavors.create(name, memory, vcpu, disk,
flavorid=flavorid,
ephemeral=ephemeral,
swap=swap,
is_public=is_public,
rxtx_factor=rxtx_factor)
is_public=is_public)
if (metadata):
flavor_extra_set(request, flavor.id, metadata)
return flavor

View File

@ -150,7 +150,6 @@ class FlavorsTable(tables.DataTable):
swap = tables.Column(get_swap_size,
verbose_name=_('Swap Disk'),
attrs={'data-type': 'size'})
rxtx_factor = tables.Column('rxtx_factor', verbose_name=_("RX/TX factor"))
flavor_id = tables.Column('id', verbose_name=_('ID'))
public = tables.Column("is_public",
verbose_name=_("Public"),

View File

@ -209,7 +209,6 @@ class BaseFlavorWorkflowTests(test.BaseAdminViewTests):
"memory": flavor.ram,
"disk": flavor.disk,
"swap": flavor.swap,
"rxtx_factor": flavor.rxtx_factor,
"ephemeral": eph,
"is_public": flavor.is_public}
if id:
@ -223,7 +222,6 @@ class BaseFlavorWorkflowTests(test.BaseAdminViewTests):
"memory_mb": flavor.ram,
"disk_gb": flavor.disk,
"swap_mb": flavor.swap,
"rxtx_factor": flavor.rxtx_factor,
"eph_gb": eph}
self._get_access_field(flavor_info, access)
if id:

View File

@ -57,10 +57,6 @@ class CreateFlavorInfoAction(workflows.Action):
required=False,
initial=0,
min_value=0)
rxtx_factor = forms.FloatField(label=_("RX/TX Factor"),
required=False,
initial=1,
min_value=1)
class Meta(object):
name = _("Flavor Information")
@ -108,8 +104,7 @@ class CreateFlavorInfo(workflows.Step):
"memory_mb",
"disk_gb",
"eph_gb",
"swap_mb",
"rxtx_factor")
"swap_mb")
class FlavorAccessAction(workflows.MembershipAction):
@ -208,7 +203,6 @@ class CreateFlavor(workflows.Workflow):
ephemeral = data.get('eph_gb') or 0
flavor_access = data['flavor_access']
is_public = not flavor_access
rxtx_factor = data.get('rxtx_factor') or 1
# Create the flavor
try:
@ -220,8 +214,7 @@ class CreateFlavor(workflows.Workflow):
ephemeral=ephemeral,
swap=swap,
flavorid=flavor_id,
is_public=is_public,
rxtx_factor=rxtx_factor)
is_public=is_public)
except Exception:
exceptions.handle(request, _('Unable to create flavor.'))
return False

View File

@ -124,7 +124,6 @@
disk: {label: gettext('Root Disk'), filters: ['gb']},
'OS-FLV-EXT-DATA:ephemeral': {label: gettext('Ephemeral Disk'), filters: ['gb']},
swap: {label: gettext('Swap Disk'), filters: ['gb']},
rxtx_factor: gettext('RX/TX Factor'),
id: gettext('ID'),
'os-flavor-access:is_public': {label: gettext('Public'), filters: ['yesno']},
metadata: gettext('Metadata')

View File

@ -4,8 +4,7 @@
property-groups="[
['name', 'id'],
['vcpus', 'ram'],
['disk', 'OS-FLV-EXT-DATA:ephemeral', 'swap'],
['rxtx_factor']]">
['disk', 'OS-FLV-EXT-DATA:ephemeral', 'swap']]">
</hz-resource-property-list>
<div class="row">
<div class="col-md-4">

View File

@ -23,13 +23,11 @@ class FlavorsTable(tables.TableRegion):
CREATE_FLAVOR_FORM_FIELDS = (("name", "flavor_id", "vcpus", "memory_mb",
"disk_gb", "eph_gb",
"swap_mb",
"rxtx_factor"),
"swap_mb"),
{"members": menus.MembershipMenuRegion})
UPDATE_FLAVOR_FORM_FIELDS = (("name", "vcpus", "memory_mb",
"disk_gb", "eph_gb", "swap_mb",
"rxtx_factor"),
"disk_gb", "eph_gb", "swap_mb"),
{"members": menus.MembershipMenuRegion})
@tables.bind_table_action('create')

View File

@ -229,7 +229,6 @@ def data(TEST):
'disk': 0,
'ram': 512,
'swap': 0,
'rxtx_factor': 1,
'extra_specs': {},
'os-flavor-access:is_public': True,
'OS-FLV-EXT-DATA:ephemeral': 0})
@ -240,7 +239,6 @@ def data(TEST):
'disk': 1024,
'ram': 10000,
'swap': 0,
'rxtx_factor': 1,
'extra_specs': {'Trusted': True, 'foo': 'bar'},
'os-flavor-access:is_public': True,
'OS-FLV-EXT-DATA:ephemeral': 2048})
@ -251,7 +249,6 @@ def data(TEST):
'disk': 1024,
'ram': 10000,
'swap': 0,
'rxtx_factor': 1,
'extra_specs': {},
'os-flavor-access:is_public': False,
'OS-FLV-EXT-DATA:ephemeral': 2048})
@ -262,7 +259,6 @@ def data(TEST):
'disk': 1024,
'ram': 10000,
'swap': 0,
'rxtx_factor': 1,
'extra_specs': FlavorExtraSpecs(
{'key': 'key_mock',
'value': 'value_mock'}),

View File

@ -585,12 +585,10 @@ class ComputeApiTests(test.APIMockTestCase):
self.assertEqual(0, api_flavor.ephemeral)
self.assertEqual(0, api_flavor.swap)
self.assertTrue(api_flavor.is_public)
self.assertEqual(1, api_flavor.rxtx_factor)
novaclient.flavors.create.assert_called_once_with(
flavor.name, flavor.ram, flavor.vcpus, flavor.disk,
flavorid='auto', ephemeral=0, swap=0, is_public=True,
rxtx_factor=1)
flavorid='auto', ephemeral=0, swap=0, is_public=True)
@mock.patch.object(api._nova, 'novaclient')
def test_flavor_delete(self, mock_novaclient):

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Deprecated rx/tx factor has been
removed out of a flavor parameters.