def create_client(self, version=None, service_type=None): """Return heat client.""" from heatclient import client as heat # ToDo: Remove explicit endpoint_type or interface initialization # when heatclient no longer uses it. kw_args = {} if self.credential.endpoint_type: kw_args["endpoint_type"] = self.credential.endpoint_type kw_args["interface"] = self.credential.endpoint_type client = heat.Client( self.choose_version(version), session=self.keystone.get_session()[0], # Remove endpoint once requirement is python-heatclient>=1.6 endpoint=self._get_endpoint(service_type), endpoint_override=self._get_endpoint(service_type), **kw_args) return client
def heatclient(request, password=None): api_version = "1" insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) endpoint = base.url_for(request, 'orchestration') LOG.debug('heatclient connection created using token "%s" and url "%s"' % (request.user.token.id, endpoint)) kwargs = { 'token': request.user.token.id, 'insecure': insecure, 'username': request.user.username, 'password': password #'timeout': args.timeout, #'ca_file': args.ca_file, #'cert_file': args.cert_file, #'key_file': args.key_file, } client = heat_client.Client(api_version, endpoint, **kwargs) client.format_parameters = format_parameters return client
def heatclient(request, password=None): api_version = "1" insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) endpoint = base.url_for(request, 'orchestration') kwargs = { 'token': request.user.token.id, 'insecure': insecure, 'ca_file': cacert, 'username': request.user.username, 'password': password # 'timeout': args.timeout, # 'ca_file': args.ca_file, # 'cert_file': args.cert_file, # 'key_file': args.key_file, } client = heat_client.Client(api_version, endpoint, **kwargs) client.format_parameters = format_parameters return client
def heatclient(user): LOG.info("start to execute heatclient") v2_auth_url = settings.AUTH_URL LOG.info("*** user is ***" + str(user)) UDC = UserDataCenter.objects.all().filter(user=user)[0] LOG.info("*** done from get udc *** ") username = UDC.keystone_user password = UDC.keystone_password project_id = UDC.tenant_uuid tenant_name = UDC.tenant_name LOG.info("username" + str(username)) LOG.info("password" + str(password)) LOG.info("project_id" + str(project_id)) LOG.info("tenant_name" + str(tenant_name)) #keystone = v2_0.client.Client(username = '******', password = '******',auth_url = 'http://192.168.0.102:5000/v2.0', tenant_name = 'admin') keystone = v2_0.client.Client(username=username, password=password, auth_url=v2_auth_url, tenant_name=tenant_name) LOG.info("keystone is" + str(keystone)) token_dict = keystone.auth_ref LOG.info("token_dict is " + str(token_dict)) token = token_dict['token']['id'] LOG.info("token is" + str(token)) #endpoint = 'http://192.168.0.102:8004/v1/' + '4ab3fb1870e34be6b8b8f6d0c4b81034' endpoint = settings.HEAT_ENDPOINT + project_id #endpoint = 'http://192.168.0.102:8004/v1/' api_version = "1" insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) client = heat_client.Client(api_version, endpoint, token=token, insecure=insecure, cacert=cacert) LOG.info("client" + str(client)) #client.format_parameters = format_parameters #return client return client
def get_heat_client(os_auth_url, os_username, os_password, os_project): keystone_auth = v2_auth.Password(os_auth_url, username=os_username, password=os_password, tenant_name=os_project) keystone_session = kssession.Session(verify=False, cert=None, timeout=None) heat_endpoint = keystone_auth.get_endpoint(keystone_session, service_type='orchestration', interface='publicURL') kwargs = { 'auth_url': os_auth_url, 'username': os_username, 'password': os_password, 'auth': keystone_auth, 'session': keystone_session, 'service_type': 'orchestration', 'endpoint_type': 'publicURL' } heat = heat_client.Client('1', heat_endpoint, **kwargs) return heat
def check_output(self, field_name, identifier, token): """ Check the results of a specific field in the outputs dictionary. None if not yet found. :param field_name: Name of the field as defined in the template. :param identifier: Identifier of a previously deployed stack. :param token: token for this request. """ res = None heat = client.Client(HEAT_VERSION, self.endpoint, token=token) stk = heat.stacks.get(identifier).to_dict() if 'outputs' in stk: for item in stk['outputs']: if item['output_key'] == field_name: res = item['output_value'] return res
def _heat(self): con = self.context endpoint_type = self._get_client_option('heat', 'endpoint_type') args = { 'auth_url': con.auth_url, 'token': self.auth_token, 'username': None, 'password': None, 'ca_file': self._get_client_option('heat', 'ca_file'), 'cert_file': self._get_client_option('heat', 'cert_file'), 'key_file': self._get_client_option('heat', 'key_file'), 'insecure': self._get_client_option('heat', 'insecure') } endpoint = self._get_heat_url() if not endpoint: endpoint = self.url_for(service_type='orchestration', endpoint_type=endpoint_type) return heatclient.Client('1', endpoint, **args)
def _attach_to_openstack(self): creds = {"username": os.environ.get('OS_USERNAME'), "password": os.environ.get('OS_PASSWORD'), "auth_url": os.environ.get('OS_AUTH_URL'), "project_domain_id": os.environ.get('OS_PROJECT_DOMAIN_ID'), "project_domain_name": os.environ.get('OS_PROJECT_DOMAIN_NAME'), "project_id": os.environ.get('OS_PROJECT_ID'), "project_name": os.environ.get('OS_PROJECT_NAME'), "tenant_name": os.environ.get('OS_TENANT_NAME'), "tenant_id": os.environ.get("OS_TENANT_ID"), "user_domain_id": os.environ.get('OS_USER_DOMAIN_ID'), "user_domain_name": os.environ.get('OS_USER_DOMAIN_NAME') } self.logger.debug("Creds: %s" % creds) loader = loading.get_plugin_loader('password') auth = loader.load_from_options(**creds) sess = session.Session(auth) self._heat_client = heatclient.Client("1", session=sess)
def app(request): lista = [ "ALIMENTACAO", "ANIMAIS", "AULAS", "AUTOMOTIVO", "BELEZA_E_BEM_ESTAR", "CASA_E_CONSTRUCAO", "COMUNICACAO_E_ARTES", "CONSULTORIA", "DELIVERY", "EVENTOS_E_MUSICA", "SAUDE", "TECNOLOGIA", "TRANSPORTE", "SEGURANCA", "OUTROS" ] loader = loading.get_plugin_loader('password') auth = loader.load_from_options( auth_url='http://180.10.10.51:35357/v3', username='******', password='******', user_domain_name='default', project_id='04a4ea69b5054d0b855f09c6ba275b06') sess = session.Session(auth=auth) heat = client.Client('1', session=sess) stacks = heat.stacks stacks.create() #print(next(heat.stacks.list())) return Response({"ok"}, status=status.HTTP_200_OK)
def heat(self): if self._heat: return self._heat con = self.context if self.auth_token is None: logger.error(_("Heat connection failed, no auth_token!")) return None args = { 'auth_url': con.auth_url, 'token': self.auth_token, 'username': None, 'password': None } endpoint = self.url_for(service_type='orchestration') self._heat = heatclient.Client('1', endpoint, **args) return self._heat
def heat_delete(shell, args): print('>>>>>> STACKS LIST') try: heat_srv = shell.keystone.services.find(type='orchestration') heat_endpoint = shell.keystone.endpoints.find(service_id=heat_srv.id) heat_url = heat_endpoint.publicurl.replace('$(tenant_id)s', args.TENANT_ID) heat = heat_client.Client('1', endpoint=heat_url, token=shell.keystone.auth_token) except Exception as e: raise e stacks = heat.stacks.list() stacks = [s for s in stacks] print_list(stacks, ['id', 'stack_name', 'stack_status']) if (len(stacks) and (args.AUTO_CLEAN or prompt_yes_no('Please confirm:'))): for stack in stacks: heat.stacks.delete(stack.id)
def _get_orchestration_client(self): endpoint = os.environ.get('HEAT_URL') if os.environ.get('OS_NO_CLIENT_AUTH') == 'True': token = None else: token = self.identity_client.auth_token try: if endpoint is None: endpoint = self.identity_client.get_endpoint_url( 'orchestration', region=self.conf.region, endpoint_type=self.conf.endpoint_type) except kc_exceptions.EndpointNotFound: return None else: return heat_client.Client(self.HEATCLIENT_VERSION, endpoint, token=token, username=self._username(), password=self._password())
def create_stacks(self, alias, project_id, template, stack_name, num_stacks=1): self.builtin.log('Creating %s stacks' % num_stacks, 'DEBUG') session = self._cache.switch(alias) heat = htclient.Client(HEAT_API_VERSION, session=session, service_type='orchestration') stacks = [] for i in range(1, int(num_stacks) + 1): fields = { 'tenant_id': project_id, 'stack_name': stack_name + '-' + str(i), 'template': template } stacks.append(heat.stacks.create(**fields)) return stacks
def start_heat_connection( #AUTH_URL = "http://172.16.0.2:5000/v3", AUTH_URL="http://localhost:35357/v3", USERNAME="******", PASSWORD="******", PROJECT_NAME="admin", USER_DOMAIN_ID="default", USER_DOMAIN_NAME="default", PROJECT_DOMAIN_ID="default"): from heatclient import client from keystoneauth1 import loading from keystoneauth1 import session loader = loading.get_plugin_loader('password') auth = loader.load_from_options(auth_url=AUTH_URL, username=USERNAME, password=PASSWORD, project_name=PROJECT_NAME, user_domain_name=USER_DOMAIN_NAME, user_domain_id=USER_DOMAIN_ID, project_domain_id=PROJECT_DOMAIN_ID) sess = session.Session(auth=auth) heat = client.Client('1', session=sess) # This implementation is required for newer versions of the python-openstackclient # from keystoneclient.auth.identity import v3 # from keystoneclient import session # # # loader = keystone.get_plugin_class('password') # auth = v3.Password(auth_url = AUTH_URL, # username = USERNAME, # password = PASSWORD, # project_name = PROJECT_NAME, # user_domain_name = USER_DOMAIN_NAME, # user_domain_id = USER_DOMAIN_ID, # project_domain_id = PROJECT_DOMAIN_ID) # sess = session.Session(auth = auth) # heat = client.Client('1', AUTH_URL, session = sess) heat.stacks.list() return heat
def heatclient(request, password=None): service_type = 'orchestration' openstack_api_versions = getattr(settings, 'OPENSTACK_API_VERSIONS', {}) api_version = openstack_api_versions.get(service_type, 1) insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) endpoint = base.url_for(request, 'orchestration') kwargs = { 'token': request.user.token.id, 'insecure': insecure, 'ca_file': cacert, 'username': request.user.username, 'password': password } client = heat_client.Client(api_version, endpoint, **kwargs) client.format_parameters = format_parameters return client
def get_orchestration_client(cls, username=None, password=None, tenant_name=None, auth_url=None, cert=None, domain='Default', **kwargs): session = cls._get_auth_session(username=username, password=password, tenant_name=tenant_name, auth_url=auth_url, cert=cert, domain=domain) service_type = 'orchestration' print(cls.HEATCLIENT_VERSION) return heat_client.Client(version=cls.HEATCLIENT_VERSION, service_type=service_type, interface=cls.INTERFACE, session=session, **kwargs)
def get_client(self): """ This function is based, with minor changes, on the official OpenStack Heat client's shell implementation. Specifically, python-heatclient/heatclient/shell.py. """ keystone_session, keystone_auth = self.get_keystone_auth() kwargs = { 'auth_url': self.options['os_auth_url'], 'session': keystone_session, 'auth': keystone_auth, 'service_type': self.service_type, 'endpoint_type': self.endpoint_type, 'region_name': self.options['os_region_name'], 'username': self.options['os_username'], 'password': self.options['os_password'] } return heat_client.Client(self.api_version, **kwargs)
def details(self, identifier, token): """ Retrieve details of the stack. :param identifier: Identifier of a previously deployed stack. :param token: token for this request. """ heat = client.Client(HEAT_VERSION, self.endpoint, token=token) stk = heat.stacks.get(identifier).to_dict() # FYI: stack states are here: http://docs.aws.amazon.com/ # AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html res = {'state': stk['stack_status'], 'name': stk['stack_name'], 'id': stk['id']} if 'outputs' in stk: res['output'] = stk['outputs'] return res
def factory(keystone_client, auth_token): heat_settings = CONF.heat heat_url = keystone_client.service_catalog.url_for( service_type='orchestration', endpoint_type=heat_settings.endpoint_type) kwargs = { 'token': auth_token, 'ca_file': heat_settings.ca_file or None, 'cert_file': heat_settings.cert_file or None, 'key_file': heat_settings.key_file or None, 'insecure': heat_settings.insecure } if not CONF.engine.use_trusts: kwargs.update({ 'username': '******', 'password': '******' }) return hclient.Client('1', heat_url, **kwargs)
def __init__(self): auth = v2.Password(auth_url=env['OS_AUTH_URL'], username=env['OS_USERNAME'], password=env['OS_PASSWORD'], tenant_id=env['OS_TENANT_ID']) sess = session.Session(auth=auth) self.keystone_client = keystone.Client(username=env['OS_USERNAME'], password=env['OS_PASSWORD'], tenant_id=env['OS_TENANT_ID'], auth_url=env['OS_AUTH_URL'], region_name=env['OS_REGION_NAME']) heat_url = self.keystone_client \ .service_catalog.url_for(service_type='orchestration', endpoint_type='publicURL') self.nova_client = nova.Client('2.1', region_name=env['OS_REGION_NAME'], session=sess) self.cinder_client = cinder.Client('2', region_name=env['OS_REGION_NAME'], session=sess) self.glance_client = glance.Client('2', region_name=env['OS_REGION_NAME'], session=sess) self.neutron_client = neutron.Client(region_name=env['OS_REGION_NAME'], session=sess) self.heat_client = heat.Client('1', region_name=env['OS_REGION_NAME'], endpoint=heat_url, session=sess)
def heat(self): if self._heat: return self._heat endpoint_type = self._get_client_option('heat', 'endpoint_type') args = { 'auth_url': self.auth_url, 'token': self.auth_token, 'username': None, 'password': None, 'ca_file': self._get_client_option('heat', 'ca_file'), 'cert_file': self._get_client_option('heat', 'cert_file'), 'key_file': self._get_client_option('heat', 'key_file'), 'insecure': self._get_client_option('heat', 'insecure') } endpoint = self.url_for(service_type='orchestration', endpoint_type=endpoint_type) self._heat = heatclient.Client('1', endpoint, **args) return self._heat
def _create(self): args = { 'auth_url': self.context.auth_url, 'token': self.auth_token, 'username': None, 'password': None, 'ca_file': self._get_client_option(CLIENT_NAME, 'ca_file'), 'cert_file': self._get_client_option(CLIENT_NAME, 'cert_file'), 'key_file': self._get_client_option(CLIENT_NAME, 'key_file'), 'insecure': self._get_client_option(CLIENT_NAME, 'insecure') } endpoint = self.get_heat_url() if self._get_client_option(CLIENT_NAME, 'url'): # assume that the heat API URL is manually configured because # it is not in the keystone catalog, so include the credentials # for the standalone auth_password middleware args['username'] = self.context.username args['password'] = self.context.password del(args['token']) return hc.Client('1', endpoint, **args)
def __init__(self, logger, ks_h, cert, cacert, key, insecure, version=1): #insecure = bool(os.getenv('OS_INSECURE', True)) self.logger = logger #self._ksc = ksc.Client(username=username, password=password, # tenant_name=project_name, auth_url=auth_url, # insecure=insecure) #url = 'http://%s:%d/v%d/%s' % (server_ip, server_port, version, # self._ksc.tenant_id) self._hc = hc.Client(version, ks_h.get_endpoint('orchestration', 'public'), token=ks_h.get_token(), ca_file=cacert, cert_file=cert, key_file=key, insecure=insecure)
def delete_stacks(self, alias, project_id, stack_name, timeout): self.builtin.log('Deleting stacks: %s' % stack_name, 'DEBUG') session = self._cache.switch(alias) heat = htclient.Client(HEAT_API_VERSION, session=session, service_type='orchestration') start_timestamp = int(datetime.datetime.now().strftime("%s")) current_timestamp = int(datetime.datetime.now().strftime("%s")) completed = False body = {'tenant_id': project_id} while current_timestamp - start_timestamp < timeout and not completed: stacks = heat.stacks.list(**body) total_stacks = 0 for stack in stacks: if str(stack.stack_name).startswith(stack_name + '-'): total_stacks += 1 stack.delete() if total_stacks > 0: time.sleep(5) current_timestamp = int(datetime.datetime.now().strftime("%s")) else: completed = True
def create_stack(tenant_name='appformix', **kwargs): #Authenticate loader = loading.get_plugin_loader('password') auth = loader.load_from_options(auth_url=auth_url, username=username, password=password, project_name=tenant_name) sess = session.Session(auth=auth) #Heat Client heatclient = client.Client('1', session=sess) #Open Yaml file, with jinja template f = open(kwargs['yaml_file']) txt = f.read() templateLoader = jinja2.FileSystemLoader(searchpath=kwargs['jinja_path']) templateEnv = jinja2.Environment(loader=templateLoader) TEMPLATE_FILE = kwargs['jinja_file'] template = templateEnv.get_template(TEMPLATE_FILE) template_vars = kwargs['stack_template'] data = yaml.load(template.render(template_vars)) #Assemble all params tx = { "files": {}, "disable_rollback": "true", "stack_name": kwargs['stack_name'], "template": txt, "parameters": data, "environment": {} } #Create Stack stack = heatclient.stacks.create(**tx) return stack
def initialize(self, _context, name, description=None): self._name = name self._template = None self._parameters = {} self._applied = True self._description = description environment = helpers.get_environment(_context) keystone_settings = config.CONF.keystone heat_settings = config.CONF.heat client = ksclient.Client(endpoint=keystone_settings.auth_url, cacert=keystone_settings.ca_file or None, cert=keystone_settings.cert_file or None, key=keystone_settings.key_file or None, insecure=keystone_settings.insecure) if not client.authenticate(auth_url=keystone_settings.auth_url, tenant_id=environment.tenant_id, token=environment.token): raise heat_exc.HTTPUnauthorized() heat_url = client.service_catalog.url_for( service_type='orchestration', endpoint_type=heat_settings.endpoint_type) self._heat_client = hclient.Client('1', heat_url, username='******', password='******', token_only=True, token=client.auth_token, ca_file=heat_settings.ca_file or None, cert_file=heat_settings.cert_file or None, key_file=heat_settings.key_file or None, insecure=heat_settings.insecure)
def getVmsAppNameThread(request, stack, stacks_obj): # LOG.info('\n\n\nStack: %s - %s - Project: %s\n\n', stack.id, stack.stack_name, stack.project) global fixed_heat_endpoint temp_endpoint = fixed_heat_endpoint.replace('%(tenant_id)s', stack.project) keystone_temp = ksclient.Client(auth_url=ENV_OS_AUTH_URL, username=ENV_OS_USERNAME, password=ENV_OS_PASSWORD, tenant_id=stack.project) heat_temp = heat_client.Client(ENV_HEAT_OS_API_VERSION, endpoint=temp_endpoint, token=keystone_temp.auth_token) resources_obj = [] for resource in heat_temp.resources.list(stack.id): if resource.resource_type == "OS::Nova::Server": server = nova.server_get(request, resource.physical_resource_id) resources_obj.append({ "resource_id": resource.physical_resource_id, "resource_name": server.name }) template = heat_temp.stacks.template(stack.id) template_params = template.get("parameters") application_name = "--" if ("application_name" in json.dumps(template_params)): application_name = template_params["application_name"]["default"] LOG.debug('Appending stack resources: %s', stack.stack_name) stacks_obj.append({ "stack_id": stack.id, "stack_name": stack.stack_name, "application_name": application_name, "resources": resources_obj })
def get_heat_client(token=None, endpoint=None, previous_tries=0): if previous_tries > 3: return None # first try to use auth details from auth_ref so we # don't need to auth with keystone every time auth_ref = get_auth_ref() auth_details = get_auth_details() keystone = get_keystone_client(auth_ref) if not token: token = keystone.auth_token if not endpoint: endpoint = get_endpoint_url_for_service('orchestration', auth_ref, get_endpoint_type( auth_details)) heat = heat_client.Client('1', endpoint=endpoint, token=token, insecure=auth_details['OS_API_INSECURE']) try: heat.build_info.build_info() except h_exc.HTTPUnauthorized: auth_ref = force_reauth() keystone = get_keystone_client(auth_ref) token = keystone.auth_token heat = get_heat_client(token, endpoint, previous_tries + 1) except h_exc.HTTPException: raise except Exception as e: metric_bool('client_success', False, m_name='maas_heat') status_err(str(e), m_name='maas_heat') return heat
def read_input_inventory(self): auth_url = os.environ.get('OS_AUTH_URL') os_username = os.environ.get('OS_USERNAME') os_project_name = os.environ.get('OS_PROJECT_NAME', os.environ.get('OS_TENANT_NAME')) os_password = os.environ.get('OS_PASSWORD') os_auth_token = os.environ.get('OS_AUTH_TOKEN') os_cacert = os.environ.get('OS_CACERT') ansible_ssh_user = os.environ.get('ANSIBLE_SSH_USER', 'heat-admin') self.plan_name = (os.environ.get('TRIPLEO_PLAN_NAME') or os.environ.get('STACK_NAME_NAME') or self.get_tripleo_plan_name()) session = get_auth_session(auth_url, os_username, os_project_name, os_password, os_auth_token, os_cacert) hclient = heat_client.Client('1', session=session) inventory = TripleoInventory(session=session, hclient=hclient, auth_url=auth_url, cacert=os_cacert, project_name=os_project_name, username=os_username, ansible_ssh_user=ansible_ssh_user, plan_name=self.plan_name) return inventory.list()
def setUpClass(cls): # Collecting of credentials: # # Support the existence of a functional_creds.conf for # testing. This makes it possible to use a config file. super(BaseMagnumClient, cls).setUpClass() user = cliutils.env('OS_USERNAME') passwd = cliutils.env('OS_PASSWORD') project_name = cliutils.env('OS_PROJECT_NAME') auth_url = cliutils.env('OS_AUTH_URL') insecure = cliutils.env('INSECURE') region_name = cliutils.env('OS_REGION_NAME') magnum_url = cliutils.env('BYPASS_URL') image_id = cliutils.env('IMAGE_ID') nic_id = cliutils.env('NIC_ID') flavor_id = cliutils.env('FLAVOR_ID') master_flavor_id = cliutils.env('MASTER_FLAVOR_ID') keypair_id = cliutils.env('KEYPAIR_ID') dns_nameserver = cliutils.env('DNS_NAMESERVER') copy_logs = cliutils.env('COPY_LOGS') user_domain_id = cliutils.env('OS_USER_DOMAIN_ID') project_domain_id = cliutils.env('OS_PROJECT_DOMAIN_ID') config = configparser.RawConfigParser() if config.read('functional_creds.conf'): # the OR pattern means the environment is preferred for # override user = user or config.get('admin', 'user') passwd = passwd or config.get('admin', 'pass') project_name = project_name or config.get('admin', 'project_name') auth_url = auth_url or config.get('auth', 'auth_url') insecure = insecure or config.get('auth', 'insecure') magnum_url = magnum_url or config.get('auth', 'magnum_url') image_id = image_id or config.get('magnum', 'image_id') nic_id = nic_id or config.get('magnum', 'nic_id') flavor_id = flavor_id or config.get('magnum', 'flavor_id') master_flavor_id = master_flavor_id or config.get( 'magnum', 'master_flavor_id') keypair_id = keypair_id or config.get('magnum', 'keypair_id') dns_nameserver = dns_nameserver or config.get( 'magnum', 'dns_nameserver') user_domain_id = user_domain_id or config.get( 'admin', 'user_domain_id') project_domain_id = project_domain_id or config.get( 'admin', 'project_domain_id') try: copy_logs = copy_logs or config.get('magnum', 'copy_logs') except configparser.NoOptionError: pass cls.image_id = image_id cls.nic_id = nic_id cls.flavor_id = flavor_id cls.master_flavor_id = master_flavor_id cls.keypair_id = keypair_id cls.dns_nameserver = dns_nameserver cls.copy_logs = str(copy_logs).lower() == 'true' # NOTE(clenimar): The recommended way to issue clients is by creating # a keystoneauth Session. Using auth parameters (e.g. username and # password) directly is deprecated. _session = cls._get_auth_session(username=user, password=passwd, project_name=project_name, project_domain_id=project_domain_id, user_domain_id=user_domain_id, auth_url=auth_url, insecure=insecure) cls.cs = v1client.Client(session=_session, insecure=insecure, service_type='container-infra', region_name=region_name, magnum_url=magnum_url, api_version='latest') cls.keystone = ksclient.Client(session=_session) # Get heat endpoint from session auth_ref = _session.auth.get_auth_ref(_session) heat_endpoint = auth_ref.service_catalog.url_for( service_type='orchestration') cls.heat = heatclient.Client('1', session=_session, auth=_session.auth, endpoint=heat_endpoint)