Fix horizon imports related to stein novaclient
The pike novaclient contains wrs extensions were being imported by horizon during startup. Those imports fail with a stein novaclient, and so the horizon code will no longer import those files. When Horizon is moved to Stein (story 2004765) this change will end up being removed. Story: 2004751 Task: 29356 Change-Id: Ia51e8b592c58eab0df09bf9b345cbae9dbf0a319 Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
parent
e936d8acec
commit
793b3e0ae9
|
@ -0,0 +1,70 @@
|
||||||
|
diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py
|
||||||
|
index 39a7684..e6798e9 100755
|
||||||
|
--- a/openstack_dashboard/api/nova.py
|
||||||
|
+++ b/openstack_dashboard/api/nova.py
|
||||||
|
@@ -38,10 +38,6 @@ from novaclient.v2 import instance_action as nova_instance_action
|
||||||
|
from novaclient.v2 import list_extensions as nova_list_extensions
|
||||||
|
from novaclient.v2 import servers as nova_servers
|
||||||
|
|
||||||
|
-# Todo (ediardo): move all wrs* and func wrappers into stx-gui
|
||||||
|
-from novaclient.v2 import wrs_pci
|
||||||
|
-from novaclient.v2 import wrs_providernets
|
||||||
|
-
|
||||||
|
from horizon import exceptions
|
||||||
|
from horizon import exceptions as horizon_exceptions
|
||||||
|
from horizon.utils import functions as utils
|
||||||
|
@@ -1123,54 +1119,6 @@ def requires_keypair():
|
||||||
|
return features.get('requires_keypair', False)
|
||||||
|
|
||||||
|
|
||||||
|
-# WRS: Nova extension for provider network.
|
||||||
|
-@profiler.trace
|
||||||
|
-def provider_network_get(request, providernet_id):
|
||||||
|
- return wrs_providernets.ProviderNetsManager(novaclient(request)).get(
|
||||||
|
- providernet_id)
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-# WRS: Nova extension for device usage
|
||||||
|
-@profiler.trace
|
||||||
|
-class DeviceUsage(base.APIResourceWrapper):
|
||||||
|
- """Wrapper for Inventory Device Usage"""
|
||||||
|
- _attrs = ['device_name', 'device_id', 'vendor_id', 'class_id',
|
||||||
|
- 'pci_vfs_configured', 'pci_vfs_used',
|
||||||
|
- 'pci_pfs_configured', 'pci_pfs_used']
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-@profiler.trace
|
||||||
|
-def get_device_usage_list(request):
|
||||||
|
- usages = wrs_pci.PciDevicesManager(novaclient(request)).list()
|
||||||
|
- return [DeviceUsage(n) for n in usages]
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-@profiler.trace
|
||||||
|
-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])
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-# WRS: Nova extension for detail device usage
|
||||||
|
-@profiler.trace
|
||||||
|
-class DetailUsage(base.APIResourceWrapper):
|
||||||
|
- """Wrapper for Inventory Device Usage"""
|
||||||
|
- _attrs = ['host',
|
||||||
|
- 'pci_vfs_configured', 'pci_vfs_used',
|
||||||
|
- 'pci_pfs_configured', 'pci_pfs_used']
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-@profiler.trace
|
||||||
|
-def get_detail_usage(request, device_id):
|
||||||
|
- usages = wrs_pci.PciDevicesManager(novaclient(request)).get(
|
||||||
|
- device_id)
|
||||||
|
- return [DetailUsage(n) for n in usages]
|
||||||
|
-
|
||||||
|
-
|
||||||
|
def can_set_quotas():
|
||||||
|
features = getattr(settings, 'OPENSTACK_HYPERVISOR_FEATURES', {})
|
||||||
|
return features.get('enable_quotas', True)
|
|
@ -30,6 +30,8 @@ Source12: horizon-region-exclusions.csv
|
||||||
Source13: guni_config.py
|
Source13: guni_config.py
|
||||||
Source14: horizon-assets-compress
|
Source14: horizon-assets-compress
|
||||||
|
|
||||||
|
Patch1: 0001-Remove-WRS-imports-from-novaclient.patch
|
||||||
|
|
||||||
#
|
#
|
||||||
# BuildArch needs to be located below patches in the spec file. Don't ask!
|
# BuildArch needs to be located below patches in the spec file. Don't ask!
|
||||||
#
|
#
|
||||||
|
@ -247,6 +249,7 @@ Customization module for OpenStack Dashboard to provide a branded logo.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n horizon-%{upstream_version} -S git
|
%autosetup -n horizon-%{upstream_version} -S git
|
||||||
|
# autosetup automatically applies the patches
|
||||||
|
|
||||||
# STX remove troublesome files introduced by tox
|
# STX remove troublesome files introduced by tox
|
||||||
rm -f openstack_dashboard/test/.secret_key_store
|
rm -f openstack_dashboard/test/.secret_key_store
|
||||||
|
|
Loading…
Reference in New Issue