Use proper way to initialize nova client
Avoid the warning message below: UserWarning: 'get_client_class' is deprecated. Please use `novaclient.client.Client` instead. Change-Id: I8483241aa8021b46acdc509bd60df31233c95cf5
This commit is contained in:
parent
89dc5d9858
commit
6d6c5431cb
|
@ -38,8 +38,6 @@ CONF = cfg.CONF
|
|||
|
||||
|
||||
class NovaAction(base.OpenStackAction):
|
||||
_client_class = novaclient.get_client_class(2)
|
||||
|
||||
def _get_client(self):
|
||||
ctx = context.ctx()
|
||||
|
||||
|
@ -48,7 +46,8 @@ class NovaAction(base.OpenStackAction):
|
|||
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
|
||||
nova_endpoint = keystone_utils.get_endpoint_for_project('nova')
|
||||
|
||||
client = self._client_class(
|
||||
client = novaclient.Client(
|
||||
2,
|
||||
username=None,
|
||||
api_key=None,
|
||||
endpoint_type='publicURL',
|
||||
|
@ -66,6 +65,10 @@ class NovaAction(base.OpenStackAction):
|
|||
|
||||
return client
|
||||
|
||||
@classmethod
|
||||
def _get_fake_client(cls):
|
||||
return novaclient.Client(2)
|
||||
|
||||
|
||||
class GlanceAction(base.OpenStackAction):
|
||||
_client_class = glanceclient.Client
|
||||
|
|
Loading…
Reference in New Issue