Merge "Do not use inner class of heatclient"
This commit is contained in:
commit
39efd896fb
|
@ -690,6 +690,9 @@
|
|||
# value)
|
||||
#insecure = false
|
||||
|
||||
# Version of Heat API to use in heatclient. (string value)
|
||||
#api_version = 1
|
||||
|
||||
|
||||
[keystone_authtoken]
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
from barbicanclient import client as barbicanclient
|
||||
from glanceclient.v2 import client as glanceclient
|
||||
from heatclient.v1 import client as heatclient
|
||||
from heatclient import client as heatclient
|
||||
from neutronclient.v2_0 import client as neutronclient
|
||||
from novaclient import client as novaclient
|
||||
from oslo_config import cfg
|
||||
|
@ -53,7 +53,10 @@ heat_client_opts = [
|
|||
cfg.BoolOpt('insecure',
|
||||
default=False,
|
||||
help=_("If set, then the server's certificate will not "
|
||||
"be verified."))]
|
||||
"be verified.")),
|
||||
cfg.StrOpt('api_version',
|
||||
default='1',
|
||||
help=_('Version of Heat API to use in heatclient.'))]
|
||||
|
||||
glance_client_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
|
@ -153,6 +156,7 @@ class OpenStackClients(object):
|
|||
|
||||
endpoint_type = self._get_client_option('heat', 'endpoint_type')
|
||||
region_name = self._get_client_option('heat', 'region_name')
|
||||
heatclient_version = self._get_client_option('heat', 'api_version')
|
||||
endpoint = self.url_for(service_type='orchestration',
|
||||
endpoint_type=endpoint_type,
|
||||
region_name=region_name)
|
||||
|
@ -168,7 +172,7 @@ class OpenStackClients(object):
|
|||
'key_file': self._get_client_option('heat', 'key_file'),
|
||||
'insecure': self._get_client_option('heat', 'insecure')
|
||||
}
|
||||
self._heat = heatclient.Client(**args)
|
||||
self._heat = heatclient.Client(heatclient_version, **args)
|
||||
|
||||
return self._heat
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
from barbicanclient import client as barbicanclient
|
||||
from glanceclient.v2 import client as glanceclient
|
||||
from heatclient.v1 import client as heatclient
|
||||
from heatclient import client as heatclient
|
||||
import mock
|
||||
from neutronclient.v2_0 import client as neutronclient
|
||||
from novaclient import client as novaclient
|
||||
|
@ -32,6 +32,8 @@ class ClientsTest(base.BaseTestCase):
|
|||
group='keystone_authtoken')
|
||||
cfg.CONF.import_opt('api_version', 'magnum.common.clients',
|
||||
group='nova_client')
|
||||
cfg.CONF.import_opt('api_version', 'magnum.common.clients',
|
||||
group='heat_client')
|
||||
|
||||
@mock.patch.object(clients.OpenStackClients, 'keystone')
|
||||
def test_url_for(self, mock_keystone):
|
||||
|
@ -72,6 +74,7 @@ class ClientsTest(base.BaseTestCase):
|
|||
obj._heat = None
|
||||
obj.heat()
|
||||
mock_call.assert_called_once_with(
|
||||
cfg.CONF.heat_client.api_version,
|
||||
endpoint='url_from_keystone', username=None,
|
||||
cert_file=None, token='3bcc3d3a03f44e3d8377f9247b0ad155',
|
||||
auth_url='keystone_url', ca_file=None, key_file=None,
|
||||
|
|
Loading…
Reference in New Issue