Remove unnecessary button visibility logic

Current logic compares number of interface and number of
interface type for "Create Interface" button visibility.

Current interface type defines 4 types, so that if more than
4 interfaces are configured in any type, "Create Interface"
will be invisible, which should not.

This fix is to remove this logic, so that user can add
interfaces through gui.

Closes-bug: 1998638

Test Plan:
PASS: "Create Interface" button is visible
      after adding 8 interfaces and we can
      add more than 8 interfaces.

Signed-off-by: Takamasa Takenaka <takamasa.takenaka@windriver.com>
Change-Id: I409a3483d6e0c4e0f53436d02d710b4dcafe2d20
This commit is contained in:
Takamasa Takenaka 2022-12-01 15:51:23 -03:00
parent b015db3a67
commit e2c5d33fab
1 changed files with 1 additions and 9 deletions

View File

@ -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
#
@ -19,8 +19,6 @@ import sysinv.common.constants as sysinv_const
LOG = logging.getLogger(__name__)
INTERFACE_CLASS_TYPES = ["platform", "data", "pci-sriov", "pci-passthrough"]
class DeleteInterface(tables.DeleteAction):
@staticmethod
@ -78,21 +76,15 @@ class CreateInterface(tables.LinkAction):
if (host._administrative != 'locked' and not is_aio_sx):
return False
count = 0
sriov_count = 0
for i in host.interfaces:
if i.ifclass:
count = count + 1
if i.ifclass == sysinv_const.INTERFACE_CLASS_PCI_SRIOV:
sriov_count += 1
if is_aio_sx and host._administrative != 'locked' and sriov_count == 0:
return False
if host.subfunctions and 'worker' not in host.subfunctions and \
count >= len(INTERFACE_CLASS_TYPES):
return False
return True