Rename max_cpu_frequency references
Change [1] renamed some host attributes. Therefore, we need to update the GUI to reference the correct attributes. Story: 2009886 Task: 45522 [1] https://review.opendev.org/c/starlingx/config/+/843661 Test plan: Change worker max_cpu_mhz_configured from GUI. Signed-off-by: Iago Estrela <IagoFilipe.EstrelaBarros@windriver.com> Change-Id: I20af495c1c6835ee781ce805cfb902e2b397cc7d
This commit is contained in:
parent
d7f8e4ca8c
commit
c41634c10b
@ -63,7 +63,7 @@ openstackdocs_auto_name = False
|
|||||||
#
|
#
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# Usually you set "language" from the command line for these cases.
|
||||||
language = None
|
language = 'en'
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
|
@ -850,7 +850,8 @@ class Host(base.APIResourceWrapper):
|
|||||||
'requires_reboot', 'boot_device', 'rootfs_device',
|
'requires_reboot', 'boot_device', 'rootfs_device',
|
||||||
'install_output', 'console', 'ttys_dcd', 'patch_state',
|
'install_output', 'console', 'ttys_dcd', 'patch_state',
|
||||||
'allow_insvc_patching', 'install_state', 'install_state_info',
|
'allow_insvc_patching', 'install_state', 'install_state_info',
|
||||||
'clock_synchronization', 'max_cpu_frequency', 'max_cpu_default']
|
'clock_synchronization', 'max_cpu_mhz_configured',
|
||||||
|
'max_cpu_mhz_allowed']
|
||||||
|
|
||||||
PERSONALITY_DISPLAY_CHOICES = (
|
PERSONALITY_DISPLAY_CHOICES = (
|
||||||
(PERSONALITY_CONTROLLER, _("Controller")),
|
(PERSONALITY_CONTROLLER, _("Controller")),
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
<dd>{{ host.hyperthreading }}</dd>
|
<dd>{{ host.hyperthreading }}</dd>
|
||||||
{% if host.personality == 'Worker' %}
|
{% if host.personality == 'Worker' %}
|
||||||
<dt>{% trans "Max CPU Frequency " %}</dt>
|
<dt>{% trans "Max CPU Frequency " %}</dt>
|
||||||
<dd>{{ host.max_cpu_frequency }}</dd>
|
<dd>{{ host.max_cpu_mhz_configured }}</dd>
|
||||||
<dt>{% trans "Max CPU Default " %}</dt>
|
<dt>{% trans "Max CPU Default " %}</dt>
|
||||||
<dd>{{ host.max_cpu_default }}</dd>
|
<dd>{{ host.max_cpu_mhz_allowed }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dl>
|
</dl>
|
||||||
<div id="cpufunctions">
|
<div id="cpufunctions">
|
||||||
|
@ -81,7 +81,7 @@ class UpdateView(workflows.WorkflowView):
|
|||||||
'bm_username': host.bm_username,
|
'bm_username': host.bm_username,
|
||||||
'ttys_dcd': host.ttys_dcd,
|
'ttys_dcd': host.ttys_dcd,
|
||||||
'clock_synchronization': host.clock_synchronization,
|
'clock_synchronization': host.clock_synchronization,
|
||||||
'max_cpu_frequency': host.max_cpu_frequency}
|
'max_cpu_mhz_configured': host.max_cpu_mhz_configured}
|
||||||
|
|
||||||
|
|
||||||
class DetailView(tabs.TabbedTableView):
|
class DetailView(tabs.TabbedTableView):
|
||||||
|
@ -55,8 +55,8 @@ BM_TYPES_CHOICES = (
|
|||||||
(sysinv.HOST_BM_TYPE_REDFISH, _("Redfish")),
|
(sysinv.HOST_BM_TYPE_REDFISH, _("Redfish")),
|
||||||
)
|
)
|
||||||
|
|
||||||
MAX_CPU_FREQUENCY_CHOICES = (
|
MAX_CPU_MHZ_CONFIGURED_CHOICES = (
|
||||||
('max_cpu_default', _("Default")),
|
('max_cpu_mhz_allowed', _("Default")),
|
||||||
('custom', _("Custom")),
|
('custom', _("Custom")),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -178,8 +178,8 @@ class UpdateHostInfoAction(workflows.Action):
|
|||||||
cpu_freq_config = forms.ChoiceField(
|
cpu_freq_config = forms.ChoiceField(
|
||||||
label=_("CPU Frequency Configuration"),
|
label=_("CPU Frequency Configuration"),
|
||||||
required=True,
|
required=True,
|
||||||
initial='max_cpu_default',
|
initial='max_cpu_mhz_allowed',
|
||||||
choices=MAX_CPU_FREQUENCY_CHOICES,
|
choices=MAX_CPU_MHZ_CONFIGURED_CHOICES,
|
||||||
widget=forms.Select(
|
widget=forms.Select(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switchable switched',
|
'class': 'switchable switched',
|
||||||
@ -188,7 +188,7 @@ class UpdateHostInfoAction(workflows.Action):
|
|||||||
_("CPU Frequency Configuration"),
|
_("CPU Frequency Configuration"),
|
||||||
'data-slug': 'cpu_freq_config'}))
|
'data-slug': 'cpu_freq_config'}))
|
||||||
|
|
||||||
max_cpu_frequency = forms.IntegerField(
|
max_cpu_mhz_configured = forms.IntegerField(
|
||||||
label=_("Max CPU Frequency (MHz)"),
|
label=_("Max CPU Frequency (MHz)"),
|
||||||
initial=1,
|
initial=1,
|
||||||
min_value=1,
|
min_value=1,
|
||||||
@ -263,8 +263,9 @@ class UpdateHostInfoAction(workflows.Action):
|
|||||||
'readonly'
|
'readonly'
|
||||||
self.fields['cpu_freq_config'].required = False
|
self.fields['cpu_freq_config'].required = False
|
||||||
|
|
||||||
if (self.initial['max_cpu_frequency'] is not None and
|
if (self.initial['max_cpu_mhz_configured'] is not None and
|
||||||
self.initial['max_cpu_frequency'] != host.max_cpu_default):
|
self.initial['max_cpu_mhz_configured'] !=
|
||||||
|
host.max_cpu_mhz_allowed):
|
||||||
self.fields['cpu_freq_config'].initial = 'custom'
|
self.fields['cpu_freq_config'].initial = 'custom'
|
||||||
|
|
||||||
def clean_location(self):
|
def clean_location(self):
|
||||||
@ -282,8 +283,8 @@ class UpdateHostInfoAction(workflows.Action):
|
|||||||
def clean(self):
|
def clean(self):
|
||||||
cleaned_data = super(UpdateHostInfoAction, self).clean()
|
cleaned_data = super(UpdateHostInfoAction, self).clean()
|
||||||
|
|
||||||
if cleaned_data['cpu_freq_config'] == 'max_cpu_default':
|
if cleaned_data['cpu_freq_config'] == 'max_cpu_mhz_allowed':
|
||||||
cleaned_data['max_cpu_frequency'] = 'max_cpu_default'
|
cleaned_data['max_cpu_mhz_configured'] = 'max_cpu_mhz_allowed'
|
||||||
|
|
||||||
disabled = self.fields['personality'].widget.attrs.get('disabled')
|
disabled = self.fields['personality'].widget.attrs.get('disabled')
|
||||||
if disabled == 'disabled':
|
if disabled == 'disabled':
|
||||||
@ -308,8 +309,8 @@ class UpdateHostInfoAction(workflows.Action):
|
|||||||
def handle(self, request, data):
|
def handle(self, request, data):
|
||||||
host_id = self.initial['host_id']
|
host_id = self.initial['host_id']
|
||||||
try:
|
try:
|
||||||
max_cpu_frequency = data['max_cpu_frequency']
|
max_cpu_mhz_configured = data['max_cpu_mhz_configured']
|
||||||
patch = {'max_cpu_frequency': max_cpu_frequency}
|
patch = {'max_cpu_mhz_configured': max_cpu_mhz_configured}
|
||||||
stx_api.sysinv.host_update(request, host_id, **patch)
|
stx_api.sysinv.host_update(request, host_id, **patch)
|
||||||
except exc.ClientException as ce:
|
except exc.ClientException as ce:
|
||||||
LOG.error(ce)
|
LOG.error(ce)
|
||||||
@ -340,7 +341,7 @@ class UpdateHostInfo(workflows.Step):
|
|||||||
"location",
|
"location",
|
||||||
"ttys_dcd",
|
"ttys_dcd",
|
||||||
"clock_synchronization",
|
"clock_synchronization",
|
||||||
"max_cpu_frequency")
|
"max_cpu_mhz_configured")
|
||||||
|
|
||||||
|
|
||||||
class UpdateInstallParamsAction(workflows.Action):
|
class UpdateInstallParamsAction(workflows.Action):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user