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:
Tyler Smith 2018-10-09 15:49:11 -04:00
parent 204859156f
commit 881affd78d
2 changed files with 5 additions and 7 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="starlingx-dashboard"
TIS_PATCH_VER=15
TIS_PATCH_VER=16

View File

@ -197,13 +197,12 @@ class AddHostInfoAction(workflows.Action):
self.fields['personality'].choices = \
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)
system_type = systems[0].to_dict().get('system_type')
if system_type == constants.TS_AIO:
self.fields['personality'].choices = \
PERSONALITY_CHOICE_CONTROLLER
self.fields['personality'].widget.attrs['disabled'] = 'disabled'
PERSONALITY_CHOICES_WITHOUT_STORAGE
# Remove compute personality if in DC mode and region
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \
@ -294,14 +293,13 @@ class UpdateHostInfoAction(workflows.Action):
self.fields['personality'].choices = \
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)
self.system_mode = systems[0].to_dict().get('system_mode')
self.system_type = systems[0].to_dict().get('system_type')
if self.system_type == constants.TS_AIO:
self.fields['personality'].choices = \
PERSONALITY_CHOICE_CONTROLLER
self.fields['personality'].widget.attrs['disabled'] = 'disabled'
PERSONALITY_CHOICES_WITHOUT_STORAGE
# Remove compute personality if in DC mode and region
if getattr(self.request.user, 'services_region', None) == 'RegionOne' \