Merge "Deprecate legacy way to retrieve neutron usage"
This commit is contained in:
commit
0d569a45de
@ -20,6 +20,7 @@ import glob
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
@ -40,6 +41,8 @@ from openstack_dashboard.defaults import * # noqa: F403,H303
|
|||||||
|
|
||||||
_LOG = logging.getLogger(__name__)
|
_LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
warnings.filterwarnings("default", category=DeprecationWarning)
|
||||||
|
|
||||||
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
|
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
if ROOT_PATH not in sys.path:
|
if ROOT_PATH not in sys.path:
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
|
import warnings
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
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
|
return qs
|
||||||
|
|
||||||
|
|
||||||
|
# TODO(amotoki): Deprecated in Ussuri. Drop this in Victoria release or later.
|
||||||
def _get_tenant_network_usages_legacy(request, usages, disabled_quotas,
|
def _get_tenant_network_usages_legacy(request, usages, disabled_quotas,
|
||||||
tenant_id):
|
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()
|
qs = base.QuotaSet()
|
||||||
_get_neutron_quota_data(request, qs, disabled_quotas, tenant_id)
|
_get_neutron_quota_data(request, qs, disabled_quotas, tenant_id)
|
||||||
for quota in qs:
|
for quota in qs:
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user