diff --git a/cloudpulseclient/openstack/common/apiclient/auth.py b/cloudpulseclient/openstack/common/apiclient/auth.py index 80a8b36..5d5716b 100644 --- a/cloudpulseclient/openstack/common/apiclient/auth.py +++ b/cloudpulseclient/openstack/common/apiclient/auth.py @@ -127,6 +127,8 @@ class BaseAuthPlugin(object): "tenant_name", "token", "auth_url", + "project_domain_name", + "user_domain_name", ] def __init__(self, auth_system=None, **kwargs): diff --git a/cloudpulseclient/shell.py b/cloudpulseclient/shell.py index e7d8ec7..b80af2b 100644 --- a/cloudpulseclient/shell.py +++ b/cloudpulseclient/shell.py @@ -33,6 +33,13 @@ from oslo_utils import encodeutils from oslo_utils import strutils import six +from cloudpulseclient.openstack.common.apiclient import auth +from cloudpulseclient.openstack.common.apiclient import exceptions as exc +from cloudpulseclient.openstack.common import cliutils +from cloudpulseclient.v1 import client +from cloudpulseclient.v1 import shell as shell_v1 +from cloudpulseclient import version + HAS_KEYRING = False all_errors = ValueError try: @@ -49,13 +56,6 @@ try: except ImportError: pass -from cloudpulseclient.openstack.common.apiclient import auth -from cloudpulseclient.openstack.common.apiclient import exceptions as exc -from cloudpulseclient.openstack.common import cliutils -from cloudpulseclient.v1 import client -from cloudpulseclient.v1 import shell as shell_v1 -from cloudpulseclient import version - DEFAULT_API_VERSION = '1' DEFAULT_ENDPOINT_TYPE = 'publicURL' DEFAULT_SERVICE_TYPE = 'health' @@ -521,16 +521,19 @@ class OpenStackCloudPulseShell(object): '--os-password, env[OS_PASSWORD], or ' 'prompted response') - self.cs = client.Client(username=os_username, - api_key=os_password, - project_id=os_tenant_id, - project_name=os_tenant_name, - auth_url=os_auth_url, - service_type=service_type, - region_name=args.os_region_name, - cacert=cacert, - insecure=insecure, - cloudpulse_url=bypass_url) + self.cs = client.Client( + username=os_username, + api_key=os_password, + project_id=os_tenant_id, + project_name=os_tenant_name, + auth_url=os_auth_url, + service_type=service_type, + region_name=args.os_region_name, + project_domain_name=args.os_project_domain_name, + user_domain_name=args.os_user_domain_name, + cacert=cacert, + insecure=insecure, + cloudpulse_url=bypass_url) args.func(self.cs, args) diff --git a/cloudpulseclient/v1/client.py b/cloudpulseclient/v1/client.py index 6cb26ff..671f09b 100644 --- a/cloudpulseclient/v1/client.py +++ b/cloudpulseclient/v1/client.py @@ -25,18 +25,22 @@ class Client(object): def __init__(self, username=None, api_key=None, project_id=None, project_name=None, auth_url=None, cloudpulse_url=None, endpoint_type='publicURL', service_type='container', + project_domain_name=None, user_domain_name=None, region_name=None, input_auth_token=None, insecure=False, cacert=None): keystone = None if not input_auth_token: - keystone = self.get_keystone_client(username=username, - api_key=api_key, - auth_url=auth_url, - project_id=project_id, - project_name=project_name, - insecure=insecure, - cacert=cacert) + keystone = self.get_keystone_client( + username=username, + api_key=api_key, + auth_url=auth_url, + project_id=project_id, + project_name=project_name, + project_domain_name=project_domain_name, + user_domain_name=user_domain_name, + insecure=insecure, + cacert=cacert) input_auth_token = keystone.auth_token if not input_auth_token: @@ -80,6 +84,7 @@ class Client(object): @staticmethod def get_keystone_client(username=None, api_key=None, auth_url=None, insecure=False, cacert=None, token=None, + project_domain_name=None, user_domain_name=None, project_id=None, project_name=None): if not auth_url: raise RuntimeError("No auth url specified") @@ -94,6 +99,8 @@ class Client(object): cacert=cacert, tenant_id=project_id, tenant_name=project_name, + project_domain_name=project_domain_name, + user_domain_name=user_domain_name, auth_url=auth_url, endpoint=auth_url) client.authenticate()