Switch to python-freezerclient
freezer-web-ui needs to be switched to python-freezerclient in the same way as freezer. freezer.apiclient is no longer available. Change-Id: Icba3e628f7b1e9305b556609bf55676a776ecfa5 Implements: blueprint switch-to-python-freezer-client Closes-Bug: #1643950 Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This commit is contained in:
parent
62767d462f
commit
b81b540c27
@ -16,10 +16,9 @@
|
||||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from horizon.utils.memoized import memoized # noqa
|
||||
from freezerclient.v1 import client as freezer_client
|
||||
|
||||
import freezer.apiclient.client
|
||||
from disaster_recovery import utils
|
||||
|
||||
|
||||
@ -35,7 +34,7 @@ def client(request):
|
||||
ks_version = getattr(settings,
|
||||
'OPENSTACK_API_VERSIONS', {}).get('identity', 2.0)
|
||||
|
||||
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||
verify = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
|
||||
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
|
||||
|
||||
credentials = {
|
||||
@ -43,8 +42,8 @@ def client(request):
|
||||
'auth_url': getattr(settings, 'OPENSTACK_KEYSTONE_URL'),
|
||||
'endpoint': api_url,
|
||||
'version': ks_version,
|
||||
'cacert': cacert,
|
||||
'insecure': insecure
|
||||
'cert': cacert,
|
||||
'verify': verify,
|
||||
}
|
||||
|
||||
if ks_version == 3:
|
||||
@ -52,7 +51,7 @@ def client(request):
|
||||
credentials['project_domain_name'] = \
|
||||
request.user.domain_name or 'Default'
|
||||
|
||||
return freezer.apiclient.client.Client(**credentials)
|
||||
return freezer_client.Client(**credentials)
|
||||
|
||||
|
||||
@memoized
|
||||
@ -427,9 +426,9 @@ class Client(object):
|
||||
if search:
|
||||
search = {"match": [{"_all": search}, ], }
|
||||
|
||||
clients = self.client.registration.list(limit=limit,
|
||||
offset=offset,
|
||||
search=search)
|
||||
clients = self.client.clients.list(limit=limit,
|
||||
offset=offset,
|
||||
search=search)
|
||||
|
||||
if json:
|
||||
return clients
|
||||
@ -441,7 +440,7 @@ class Client(object):
|
||||
) for c in clients]
|
||||
|
||||
def get(self, client_id, json=False):
|
||||
c = self.client.registration.get(client_id)
|
||||
c = self.client.clients.get(client_id)
|
||||
|
||||
if json:
|
||||
return c
|
||||
@ -452,7 +451,7 @@ class Client(object):
|
||||
c.get('uuid'))
|
||||
|
||||
def delete(self, client_id):
|
||||
return self.client.registration.delete(client_id)
|
||||
return self.client.clients.delete(client_id)
|
||||
|
||||
|
||||
class Backup(object):
|
||||
|
@ -2,3 +2,4 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
Django<1.9,>=1.8 # BSD
|
||||
python-freezerclient>=1.0.0 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user