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
|
import logging
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from horizon.utils.memoized import memoized # noqa
|
from horizon.utils.memoized import memoized # noqa
|
||||||
|
from freezerclient.v1 import client as freezer_client
|
||||||
|
|
||||||
import freezer.apiclient.client
|
|
||||||
from disaster_recovery import utils
|
from disaster_recovery import utils
|
||||||
|
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ def client(request):
|
|||||||
ks_version = getattr(settings,
|
ks_version = getattr(settings,
|
||||||
'OPENSTACK_API_VERSIONS', {}).get('identity', 2.0)
|
'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)
|
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
|
||||||
|
|
||||||
credentials = {
|
credentials = {
|
||||||
@ -43,8 +42,8 @@ def client(request):
|
|||||||
'auth_url': getattr(settings, 'OPENSTACK_KEYSTONE_URL'),
|
'auth_url': getattr(settings, 'OPENSTACK_KEYSTONE_URL'),
|
||||||
'endpoint': api_url,
|
'endpoint': api_url,
|
||||||
'version': ks_version,
|
'version': ks_version,
|
||||||
'cacert': cacert,
|
'cert': cacert,
|
||||||
'insecure': insecure
|
'verify': verify,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ks_version == 3:
|
if ks_version == 3:
|
||||||
@ -52,7 +51,7 @@ def client(request):
|
|||||||
credentials['project_domain_name'] = \
|
credentials['project_domain_name'] = \
|
||||||
request.user.domain_name or 'Default'
|
request.user.domain_name or 'Default'
|
||||||
|
|
||||||
return freezer.apiclient.client.Client(**credentials)
|
return freezer_client.Client(**credentials)
|
||||||
|
|
||||||
|
|
||||||
@memoized
|
@memoized
|
||||||
@ -427,7 +426,7 @@ class Client(object):
|
|||||||
if search:
|
if search:
|
||||||
search = {"match": [{"_all": search}, ], }
|
search = {"match": [{"_all": search}, ], }
|
||||||
|
|
||||||
clients = self.client.registration.list(limit=limit,
|
clients = self.client.clients.list(limit=limit,
|
||||||
offset=offset,
|
offset=offset,
|
||||||
search=search)
|
search=search)
|
||||||
|
|
||||||
@ -441,7 +440,7 @@ class Client(object):
|
|||||||
) for c in clients]
|
) for c in clients]
|
||||||
|
|
||||||
def get(self, client_id, json=False):
|
def get(self, client_id, json=False):
|
||||||
c = self.client.registration.get(client_id)
|
c = self.client.clients.get(client_id)
|
||||||
|
|
||||||
if json:
|
if json:
|
||||||
return c
|
return c
|
||||||
@ -452,7 +451,7 @@ class Client(object):
|
|||||||
c.get('uuid'))
|
c.get('uuid'))
|
||||||
|
|
||||||
def delete(self, client_id):
|
def delete(self, client_id):
|
||||||
return self.client.registration.delete(client_id)
|
return self.client.clients.delete(client_id)
|
||||||
|
|
||||||
|
|
||||||
class Backup(object):
|
class Backup(object):
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
Django<1.9,>=1.8 # BSD
|
Django<1.9,>=1.8 # BSD
|
||||||
|
python-freezerclient>=1.0.0 # Apache-2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user