diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py index c86a582a34..4e5e8d95d6 100644 --- a/openstack_dashboard/settings.py +++ b/openstack_dashboard/settings.py @@ -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: diff --git a/openstack_dashboard/usage/quotas.py b/openstack_dashboard/usage/quotas.py index e563285154..7986abce96 100644 --- a/openstack_dashboard/usage/quotas.py +++ b/openstack_dashboard/usage/quotas.py @@ -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: diff --git a/releasenotes/notes/deprecate-neutron-quota-legacy-144468a1b269cce8.yaml b/releasenotes/notes/deprecate-neutron-quota-legacy-144468a1b269cce8.yaml new file mode 100644 index 0000000000..d3a8203614 --- /dev/null +++ b/releasenotes/notes/deprecate-neutron-quota-legacy-144468a1b269cce8.yaml @@ -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.