Computes cannot be added in Horizon in Virtual Duplex Environment
Changing the system type checking in add/edit host workflow Change-Id: I8b1e9aa1545625c5fcd0ee54678e88cdced4273a Closes-bug: 1795505 Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
This commit is contained in:
parent
204859156f
commit
881affd78d
|
@ -1,2 +1,2 @@
|
||||||
SRC_DIR="starlingx-dashboard"
|
SRC_DIR="starlingx-dashboard"
|
||||||
TIS_PATCH_VER=15
|
TIS_PATCH_VER=16
|
||||||
|
|
|
@ -197,13 +197,12 @@ class AddHostInfoAction(workflows.Action):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
||||||
|
|
||||||
# All-in-one system, personality can only be controller.
|
# All-in-one system, personality can be controller or compute.
|
||||||
systems = stx_api.sysinv.system_list(request)
|
systems = stx_api.sysinv.system_list(request)
|
||||||
system_type = systems[0].to_dict().get('system_type')
|
system_type = systems[0].to_dict().get('system_type')
|
||||||
if system_type == constants.TS_AIO:
|
if system_type == constants.TS_AIO:
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICE_CONTROLLER
|
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
||||||
self.fields['personality'].widget.attrs['disabled'] = 'disabled'
|
|
||||||
|
|
||||||
# Remove compute personality if in DC mode and region
|
# Remove compute personality if in DC mode and region
|
||||||
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
|
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
|
||||||
|
@ -294,14 +293,13 @@ class UpdateHostInfoAction(workflows.Action):
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
||||||
|
|
||||||
# All-in-one system, personality can only be controller.
|
# All-in-one system, personality can only be controller or compute.
|
||||||
systems = stx_api.sysinv.system_list(request)
|
systems = stx_api.sysinv.system_list(request)
|
||||||
self.system_mode = systems[0].to_dict().get('system_mode')
|
self.system_mode = systems[0].to_dict().get('system_mode')
|
||||||
self.system_type = systems[0].to_dict().get('system_type')
|
self.system_type = systems[0].to_dict().get('system_type')
|
||||||
if self.system_type == constants.TS_AIO:
|
if self.system_type == constants.TS_AIO:
|
||||||
self.fields['personality'].choices = \
|
self.fields['personality'].choices = \
|
||||||
PERSONALITY_CHOICE_CONTROLLER
|
PERSONALITY_CHOICES_WITHOUT_STORAGE
|
||||||
self.fields['personality'].widget.attrs['disabled'] = 'disabled'
|
|
||||||
|
|
||||||
# Remove compute personality if in DC mode and region
|
# Remove compute personality if in DC mode and region
|
||||||
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
|
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
|
||||||
|
|
Loading…
Reference in New Issue