From 0022f4a0baac2c0d50489ea7d1ad40a9524f0377 Mon Sep 17 00:00:00 2001
From: Shu Muto <shu.mutow@gmail.com>
Date: Wed, 24 Oct 2018 16:33:12 +0900
Subject: [PATCH] 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
---
 zun_ui/api/client.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/zun_ui/api/client.py b/zun_ui/api/client.py
index 49d6517..2fb21e4 100644
--- a/zun_ui/api/client.py
+++ b/zun_ui/api/client.py
@@ -16,7 +16,7 @@ import shlex
 from django.conf import settings
 
 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 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)
-def zunclient(request_auth_params):
+@memoized
+def zunclient(request):
     (
         username,
         token_id,
         project_id,
         endpoint_override
-    ) = request_auth_params
+    ) = get_auth_params_from_request(request)
 
     LOG.debug('zunclient connection created using the token "%s" and url'
               ' "%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)
-def neutronclient(request_auth_params):
-    token_id, neutron_url, auth_url = request_auth_params
+@memoized
+def neutronclient(request):
+    (
+        token_id,
+        neutron_url,
+        auth_url
+    ) = get_auth_params_from_request_neutron(request)
     insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
     cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)