Use new board management type enumuration
Change horizon to list new board management type enumeration list below: redfish ipmi dynamic none (bm is not provisioned) Closes-Bug: 1852328 Depends-On: https://review.opendev.org/#/c/698281 Change-Id: If64eff8b0ee63509bdada6bba05847d292ce8032 Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
parent
4c29c7f7da
commit
d1c22e49a9
|
@ -21,7 +21,6 @@ import math
|
||||||
|
|
||||||
from cgtsclient.v1 import client as cgts_client
|
from cgtsclient.v1 import client as cgts_client
|
||||||
from cgtsclient.v1 import icpu as icpu_utils
|
from cgtsclient.v1 import icpu as icpu_utils
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
@ -43,10 +42,6 @@ PERSONALITY_UNKNOWN = 'unknown'
|
||||||
SUBFUNCTIONS_WORKER = 'worker'
|
SUBFUNCTIONS_WORKER = 'worker'
|
||||||
SUBFUNCTIONS_LOWLATENCY = 'lowlatency'
|
SUBFUNCTIONS_LOWLATENCY = 'lowlatency'
|
||||||
|
|
||||||
BM_TYPE_NULL = ''
|
|
||||||
BM_TYPE_NONE = 'none'
|
|
||||||
BM_TYPE_GENERIC = 'bmc'
|
|
||||||
|
|
||||||
RECORDTYPE_INSTALL = 'install'
|
RECORDTYPE_INSTALL = 'install'
|
||||||
RECORDTYPE_INSTALL_ANSWER = 'install_answers'
|
RECORDTYPE_INSTALL_ANSWER = 'install_answers'
|
||||||
RECORDTYPE_RECONFIG = 'reconfig'
|
RECORDTYPE_RECONFIG = 'reconfig'
|
||||||
|
@ -108,6 +103,12 @@ CLOCK_SYNCHRONIZATION_CHOICES = (
|
||||||
(constants.PTP, _("ptp")),
|
(constants.PTP, _("ptp")),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Host Board Management Constants
|
||||||
|
HOST_BM_TYPE_DEPROVISIONED = "none"
|
||||||
|
HOST_BM_TYPE_IPMI = "ipmi"
|
||||||
|
HOST_BM_TYPE_REDFISH = "redfish"
|
||||||
|
HOST_BM_TYPE_DYNAMIC = "dynamic"
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1009,11 +1010,6 @@ class Host(base.APIResourceWrapper):
|
||||||
@property
|
@property
|
||||||
def bm_type(self):
|
def bm_type(self):
|
||||||
bm_type = self._bm_type
|
bm_type = self._bm_type
|
||||||
if bm_type and not bm_type.lower().startswith(BM_TYPE_NONE):
|
|
||||||
bm_type = BM_TYPE_GENERIC
|
|
||||||
else:
|
|
||||||
bm_type = BM_TYPE_NULL
|
|
||||||
|
|
||||||
return bm_type
|
return bm_type
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -51,8 +51,10 @@ PERSONALITY_CHOICE_CONTROLLER = (
|
||||||
)
|
)
|
||||||
|
|
||||||
BM_TYPES_CHOICES = (
|
BM_TYPES_CHOICES = (
|
||||||
(stx_api.sysinv.BM_TYPE_NULL, _('No Board Management')),
|
(sysinv.HOST_BM_TYPE_DEPROVISIONED, _('No Board Management')),
|
||||||
(stx_api.sysinv.BM_TYPE_GENERIC, _("Board Management Controller")),
|
(sysinv.HOST_BM_TYPE_DYNAMIC, _("Dynamic (learn)")),
|
||||||
|
(sysinv.HOST_BM_TYPE_IPMI, _("IPMI")),
|
||||||
|
(sysinv.HOST_BM_TYPE_REDFISH, _("Redfish")),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -589,8 +591,12 @@ class BoardManagementAction(workflows.Action):
|
||||||
widget=forms.TextInput(attrs={
|
widget=forms.TextInput(attrs={
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'bm_type',
|
'data-switch-on': 'bm_type',
|
||||||
'data-bm_type-' +
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_DYNAMIC:
|
||||||
stx_api.sysinv.BM_TYPE_GENERIC: FIELD_LABEL_BM_IP}))
|
FIELD_LABEL_BM_IP,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_IPMI:
|
||||||
|
FIELD_LABEL_BM_IP,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_REDFISH:
|
||||||
|
FIELD_LABEL_BM_IP}))
|
||||||
|
|
||||||
bm_username = forms.CharField(
|
bm_username = forms.CharField(
|
||||||
label=FIELD_LABEL_BM_USERNAME,
|
label=FIELD_LABEL_BM_USERNAME,
|
||||||
|
@ -599,8 +605,12 @@ class BoardManagementAction(workflows.Action):
|
||||||
'autocomplete': 'off',
|
'autocomplete': 'off',
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'bm_type',
|
'data-switch-on': 'bm_type',
|
||||||
'data-bm_type-' +
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_DYNAMIC:
|
||||||
stx_api.sysinv.BM_TYPE_GENERIC: FIELD_LABEL_BM_USERNAME}))
|
FIELD_LABEL_BM_USERNAME,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_IPMI:
|
||||||
|
FIELD_LABEL_BM_USERNAME,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_REDFISH:
|
||||||
|
FIELD_LABEL_BM_USERNAME}))
|
||||||
|
|
||||||
bm_password = forms.RegexField(
|
bm_password = forms.RegexField(
|
||||||
label=FIELD_LABEL_BM_PASSWORD,
|
label=FIELD_LABEL_BM_PASSWORD,
|
||||||
|
@ -610,8 +620,12 @@ class BoardManagementAction(workflows.Action):
|
||||||
'autocomplete': 'off',
|
'autocomplete': 'off',
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'bm_type',
|
'data-switch-on': 'bm_type',
|
||||||
'data-bm_type-' +
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_DYNAMIC:
|
||||||
stx_api.sysinv.BM_TYPE_GENERIC: FIELD_LABEL_BM_PASSWORD}),
|
FIELD_LABEL_BM_PASSWORD,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_IPMI:
|
||||||
|
FIELD_LABEL_BM_PASSWORD,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_REDFISH:
|
||||||
|
FIELD_LABEL_BM_PASSWORD}),
|
||||||
regex=validators.password_validator(),
|
regex=validators.password_validator(),
|
||||||
required=False,
|
required=False,
|
||||||
error_messages={'invalid': validators.password_validator_msg()})
|
error_messages={'invalid': validators.password_validator_msg()})
|
||||||
|
@ -624,8 +638,11 @@ class BoardManagementAction(workflows.Action):
|
||||||
'autocomplete': 'off',
|
'autocomplete': 'off',
|
||||||
'class': 'switched',
|
'class': 'switched',
|
||||||
'data-switch-on': 'bm_type',
|
'data-switch-on': 'bm_type',
|
||||||
'data-bm_type-' +
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_DYNAMIC:
|
||||||
stx_api.sysinv.BM_TYPE_GENERIC:
|
FIELD_LABEL_BM_CONFIRM_PASSWORD,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_IPMI:
|
||||||
|
FIELD_LABEL_BM_CONFIRM_PASSWORD,
|
||||||
|
'data-bm_type-' + sysinv.HOST_BM_TYPE_REDFISH:
|
||||||
FIELD_LABEL_BM_CONFIRM_PASSWORD}),
|
FIELD_LABEL_BM_CONFIRM_PASSWORD}),
|
||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue