Browse Source

Merge "Deprecate legacy way to retrieve neutron usage"

tags/18.3.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
0d569a45de
3 changed files with 19 additions and 0 deletions
  1. +3
    -0
      openstack_dashboard/settings.py
  2. +7
    -0
      openstack_dashboard/usage/quotas.py
  3. +9
    -0
      releasenotes/notes/deprecate-neutron-quota-legacy-144468a1b269cce8.yaml

+ 3
- 0
openstack_dashboard/settings.py View File

@@ -20,6 +20,7 @@ import glob
import logging
import os
import sys
import warnings

from django.utils.translation import ugettext_lazy as _

@@ -40,6 +41,8 @@ from openstack_dashboard.defaults import * # noqa: F403,H303

_LOG = logging.getLogger(__name__)

warnings.filterwarnings("default", category=DeprecationWarning)

ROOT_PATH = os.path.dirname(os.path.abspath(__file__))

if ROOT_PATH not in sys.path:


+ 7
- 0
openstack_dashboard/usage/quotas.py View File

@@ -13,6 +13,7 @@
from collections import defaultdict
import itertools
import logging
import warnings

from django.utils.translation import ugettext_lazy as _

@@ -361,8 +362,14 @@ def _get_neutron_quota_data(request, qs, disabled_quotas, tenant_id):
return qs


# TODO(amotoki): Deprecated in Ussuri. Drop this in Victoria release or later.
def _get_tenant_network_usages_legacy(request, usages, disabled_quotas,
tenant_id):
warnings.warn(
"The legacy way to retrieve neutron resource usage is deprecated "
"in Ussuri release. Horizon will depend on 'quota_details' "
"neutron extension added in Pike release in future.",
DeprecationWarning)
qs = base.QuotaSet()
_get_neutron_quota_data(request, qs, disabled_quotas, tenant_id)
for quota in qs:


+ 9
- 0
releasenotes/notes/deprecate-neutron-quota-legacy-144468a1b269cce8.yaml View File

@@ -0,0 +1,9 @@
---
deprecations:
- |
The legacy way to retrive neutron resource usages is deprecated.
In future, horizon will require ``quota_details`` neutron extension.
In the legacy way, horizon list all related resources to count resource usage.
It is not efficient and ``quota_details`` neutron extension was added
to address it. It was implemented in Pike release and the enough migration
period has passed, so we deprecate the legacy way.

Loading…
Cancel
Save