Merge "Fix 'Edit Host' modal"
This commit is contained in:
commit
559f04a695
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2021 Wind River Systems, Inc.
|
# Copyright (c) 2013-2022 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
@ -141,6 +141,7 @@ class AddHostInfoAction(workflows.Action):
|
||||||
|
|
||||||
|
|
||||||
class UpdateHostInfoAction(workflows.Action):
|
class UpdateHostInfoAction(workflows.Action):
|
||||||
|
failure_message = _('Unable to modify host "%s".')
|
||||||
host_id = forms.CharField(widget=forms.widgets.HiddenInput)
|
host_id = forms.CharField(widget=forms.widgets.HiddenInput)
|
||||||
|
|
||||||
personality = forms.ChoiceField(label=_("Personality"),
|
personality = forms.ChoiceField(label=_("Personality"),
|
||||||
|
@ -192,7 +193,7 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
label=_("Max CPU Frequency (MHz)"),
|
label=_("Max CPU Frequency (MHz)"),
|
||||||
initial=1,
|
initial=1,
|
||||||
min_value=1,
|
min_value=1,
|
||||||
required=True,
|
required=False,
|
||||||
widget=forms.TextInput(
|
widget=forms.TextInput(
|
||||||
attrs={
|
attrs={
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
|
@ -283,9 +284,6 @@ 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_mhz_allowed':
|
|
||||||
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':
|
||||||
if self.system_type == constants.TS_AIO:
|
if self.system_type == constants.TS_AIO:
|
||||||
|
@ -316,7 +314,6 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
LOG.error(ce)
|
LOG.error(ce)
|
||||||
msg = self.failure_message + " " + str(ce)
|
msg = self.failure_message + " " + str(ce)
|
||||||
self.failure_message = msg
|
self.failure_message = msg
|
||||||
exceptions.handle(request, msg)
|
|
||||||
return False
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = str(e)
|
msg = str(e)
|
||||||
|
|
Loading…
Reference in New Issue