[cgtsclient] Not support SSL or the insecure parameter

Bug #1976168 reported by Jon Zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Unassigned

Bug Description

Hello,

When I use the cgtsclient with an SSL environment, it throws an EndpointException, and I try to use the "insecure" parameter, but, it does not support since this commit[https://opendev.org/starlingx/config/commit/39919f7be0dc54ef90bac1e665194572f6c04ec1]

I paste my testing code here:
-------------------------------------------------------------
import os
import sys
from cgtsclient.client import get_client

_DEFAULT_STX_URL = "http://192.168.204.1:5000/v3"

def get_stx_access_info(region_name="RegionOne"):
    try:
        client_args = dict(
            auth_url=os.environ.get('OS_AUTH_URL', _DEFAULT_STX_URL),
            username=os.environ.get('OS_USERNAME', "admin"),
            api_key=os.environ.get('OS_PASSWORD', "fakepasswd1"),
            project_name=os.environ.get('OS_PROJECT_NAME', "admin"),
        )
    except KeyError:
        sys.exit(1)

    os_client_args = {}
    for key, val in client_args.items():
        os_client_args['os_{key}'.format(key=key)] = val
    os_client_args['insecure'] = True
    os_client_args['os_endpoint_type'] = 'public'
    os_client_args['os_password'] = os_client_args.pop('os_api_key')
    os_client_args['os_region_name'] = region_name
    os_client_args['api_version'] = 1
    # os_client_args['user_domain_name'] = 'Default'
    # os_client_args['project_domain_name'] = 'Default'
    return os_client_args

def test():
    os_client_args = get_stx_access_info()
    client = get_client(**os_client_args)
    print(client.isystem.list())

test()
--------------------------------------------------------------------
It needs some bash environment to specify stx information:
export OS_AUTH_URL=https://<address>:5000/v3
export OS_PASSWORD=<password>

--------------------------------------------------------------------

Thank you

Tags: stx.clients
Ghada Khalil (gkhalil)
tags: added: stx.clients
Revision history for this message
John Kung (john-kung) wrote :
Revision history for this message
Ramaswamy Subramanian (rsubrama) wrote :

Appears to be a duplicate of 1980417.

Changed in starlingx:
status: New → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.