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:
Ruslan Aliev 2016-11-22 21:40:12 +03:00
parent 62767d462f
commit b81b540c27
2 changed files with 11 additions and 11 deletions

View File

@ -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):

View File

@ -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