Replace @memoized_with_request to @memoized
Horizon replaced @memoized_with_request to @memoized for client module. Plugins need to replace it as same as Horizon. Change-Id: I050bc27236700b8469890468efba46bec5c7d246 Closes-Bug: #1799650
This commit is contained in:
parent
3cd7a2c335
commit
0022f4a0ba
@ -16,7 +16,7 @@ import shlex
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon.utils.memoized import memoized_with_request
|
from horizon.utils.memoized import memoized
|
||||||
from openstack_dashboard.api import base
|
from openstack_dashboard.api import base
|
||||||
|
|
||||||
from neutronclient.v2_0 import client as neutron_client
|
from neutronclient.v2_0 import client as neutron_client
|
||||||
@ -52,14 +52,14 @@ def get_auth_params_from_request(request):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@memoized_with_request(get_auth_params_from_request)
|
@memoized
|
||||||
def zunclient(request_auth_params):
|
def zunclient(request):
|
||||||
(
|
(
|
||||||
username,
|
username,
|
||||||
token_id,
|
token_id,
|
||||||
project_id,
|
project_id,
|
||||||
endpoint_override
|
endpoint_override
|
||||||
) = request_auth_params
|
) = get_auth_params_from_request(request)
|
||||||
|
|
||||||
LOG.debug('zunclient connection created using the token "%s" and url'
|
LOG.debug('zunclient connection created using the token "%s" and url'
|
||||||
' "%s"' % (token_id, endpoint_override))
|
' "%s"' % (token_id, endpoint_override))
|
||||||
@ -93,9 +93,13 @@ def get_auth_params_from_request_neutron(request):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@memoized_with_request(get_auth_params_from_request_neutron)
|
@memoized
|
||||||
def neutronclient(request_auth_params):
|
def neutronclient(request):
|
||||||
token_id, neutron_url, auth_url = request_auth_params
|
(
|
||||||
|
token_id,
|
||||||
|
neutron_url,
|
||||||
|
auth_url
|
||||||
|
) = get_auth_params_from_request_neutron(request)
|
||||||
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||||
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
|
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user