Remove calls to non existant novaclient imports

The wrs_pci and wrs_providernet python files do
not exist in novaclient.

This change removes those imports.

The GUI code that is processing the results from
those imports is not currently been removed, as it may be
used by upcoming enhancements to sysinv.

Story: 2004751
Task: 29357
Change-Id: I39dfbdf60d9de008072253f1074fb2ee5c61df72
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey 2019-02-04 14:03:01 -06:00
parent 6dd408957b
commit 43e07f799c
5 changed files with 6 additions and 65 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="starlingx-dashboard"
TIS_PATCH_VER=26
TIS_PATCH_VER=27

View File

@ -4,11 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
#
from novaclient.v2 import wrs_pci
from novaclient.v2 import wrs_providernets
from openstack_dashboard.api import base
from openstack_dashboard.api.nova import nova_exceptions
from openstack_dashboard.api.nova import novaclient
@ -27,42 +22,3 @@ def server_group_create(request, name, project_id, metadata, policies):
def server_group_delete(request, server_group_id):
return novaclient(request).server_groups.delete(server_group_id)
def provider_network_get(request, providernet_id):
return wrs_providernets.ProviderNetsManager(novaclient(request)).get(
providernet_id)
class DeviceUsage(base.APIResourceWrapper):
"""Wrapper for Inventory Device Usage"""
_attrs = ['device_id', 'device_name', 'vendor_id', 'class_id',
'pci_vfs_configured', 'pci_vfs_used',
'pci_pfs_configured', 'pci_pfs_used']
def get_device_usage_list(request):
usages = wrs_pci.PciDevicesManager(novaclient(request)).list()
return [DeviceUsage(n) for n in usages]
def get_device_usage(request, device_id):
if device_id is None:
raise nova_exceptions.ResourceNotFound
usage = wrs_pci.PciDevicesManager(novaclient(request)).list(
device=device_id)
return DeviceUsage(usage[0])
class DetailUsage(base.APIResourceWrapper):
"""Wrapper for Inventory Device Usage"""
_attrs = ['host',
'pci_vfs_configured', 'pci_vfs_used',
'pci_pfs_configured', 'pci_pfs_used']
def get_detail_usage(request, device_id):
usages = wrs_pci.PciDevicesManager(novaclient(request)).get(
device_id)
return [DetailUsage(n) for n in usages]

View File

@ -1,2 +1,2 @@
from starlingx_dashboard.horizon.tables.actions import FixedWithQueryFilter # noqa
from starlingx_dashboard.horizon.tables.actions import LimitAction # noqa
from starlingx_dashboard.horizon.tables.actions import FixedWithQueryFilter # noqa
from starlingx_dashboard.horizon.tables.actions import LimitAction # noqa

View File

@ -7,8 +7,7 @@
# be installed in a specific order.
#
# Hacking should appear first in case something else depends on pep8
hacking<0.11,>=0.10.0
#
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage>=3.6 # Apache-2.0
django-nose>=1.4.4 # BSD
mock>=2.0 # BSD

18
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = pep8
envlist = pep8,pylint
minversion = 2.3
skipsdist = True
stxdir = {toxinidir}/..
@ -28,12 +28,6 @@ commands =
-o -type f -name '*.yaml' \
-print0 | xargs --no-run-if-empty -0 yamllint"
[pep8]
# Ignoring these warnings
# E501 line too long
ignore = E501,E129
[flake8]
# H102 Apache 2.0 license header not found
# B301 Python 3 does not include `.iter*` methods on dictionaries.
@ -48,10 +42,6 @@ enable-extensions = H106,H203,H904
basepython = python3
usedevelop = False
skip_install = True
deps =
hacking
flake8-bugbear
flake8<3.6.0
commands =
flake8
@ -60,8 +50,6 @@ basepython = python2.7
usedevelop = False
skip_install = True
deps = {[testenv]deps}
git+git://github.com/starlingx-staging/stx-python-novaclient.git
git+git://github.com/starlingx-staging/stx-python-neutronclient.git
git+git://github.com/starlingx-staging/stx-horizon.git
git+git://github.com/starlingx-staging/stx-distcloud-client.git
-e{[tox]stxdir}/stx-config/sysinv/cgts-client/cgts-client
@ -72,9 +60,7 @@ deps = {[testenv]deps}
requests-toolbelt
pylint
commands =
pylint --rcfile=./pylint.rc --version
pylint starlingx-dashboard/starlingx-dashboard/starlingx_dashboard \
--rcfile=./pylint.rc
pylint starlingx-dashboard/starlingx-dashboard/starlingx_dashboard --rcfile=./pylint.rc
[testenv:venv]
basepython = python3