diff options
author | Rex Lee <limingjiang@huawei.com> | 2016-12-15 09:01:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-15 09:01:21 +0000 |
commit | 96b30b364a0b88a15c38bd22883bb40bbcb6f428 (patch) | |
tree | abbf3280d7c20b02d89c87de73f776431ea8071a /yardstick/orchestrator/heat.py | |
parent | cc337e939dd07f51d9d414cc91e312ff139a8d2d (diff) | |
parent | 99736a3882982aef0776f80056202ee745eb3fa4 (diff) |
Merge "Add support for OpenSrack Newton"
Diffstat (limited to 'yardstick/orchestrator/heat.py')
-rw-r--r-- | yardstick/orchestrator/heat.py | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py index f3a191503..4839455e1 100644 --- a/yardstick/orchestrator/heat.py +++ b/yardstick/orchestrator/heat.py @@ -7,10 +7,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -""" Heat template and stack management -""" +"""Heat template and stack management""" -import os import time import datetime import getpass @@ -18,10 +16,11 @@ import socket import logging import pkg_resources import json -import heatclient.client -import keystoneclient + +import heatclient from yardstick.common import template_format +import yardstick.common.openstack_utils as op_utils log = logging.getLogger(__name__) @@ -30,32 +29,18 @@ log = logging.getLogger(__name__) class HeatObject(object): ''' base class for template and stack''' def __init__(self): - self._keystone_client = None self._heat_client = None self.uuid = None - def _get_keystone_client(self): - '''returns a keystone client instance''' - - if self._keystone_client is None: - self._keystone_client = keystoneclient.v2_0.client.Client( - auth_url=os.environ.get('OS_AUTH_URL'), - username=os.environ.get('OS_USERNAME'), - password=os.environ.get('OS_PASSWORD'), - tenant_name=os.environ.get('OS_TENANT_NAME'), - cacert=os.environ.get('OS_CACERT')) - - return self._keystone_client - def _get_heat_client(self): '''returns a heat client instance''' if self._heat_client is None: - keystone = self._get_keystone_client() - heat_endpoint = keystone.service_catalog.url_for( - service_type='orchestration') + sess = op_utils.get_session() + heat_endpoint = op_utils.get_endpoint(service_type='orchestration') self._heat_client = heatclient.client.Client( - '1', endpoint=heat_endpoint, token=keystone.auth_token) + op_utils.get_heat_api_version(), + endpoint=heat_endpoint, session=sess) return self._heat_client |