def make_client(instance):
    """Returns an neutron client.
    """
    neutron_client = utils.get_client_class(
        API_NAME,
        instance._api_version[API_NAME],
        API_VERSIONS,
    )
    instance.initialize()
    url = instance._url
    url = url.rstrip("/")
    if '2.0' == instance._api_version[API_NAME]:
        client = neutron_client(username=instance._username,
                                tenant_name=instance._tenant_name,
                                password=instance._password,
                                region_name=instance._region_name,
                                auth_url=instance._auth_url,
                                endpoint_url=url,
                                token=instance._token,
                                auth_strategy=instance._auth_strategy,
                                insecure=instance._insecure)
        return client
    else:
        raise exceptions.UnsupportedVersion("API version %s is not supported" %
                                            instance._api_version[API_NAME])
def make_client(instance):
    """Returns an neutron client."""
    neutron_client = utils.get_client_class(
        API_NAME,
        instance._api_version[API_NAME],
        API_VERSIONS,
    )
    instance.initialize()
    url = instance._url
    url = url.rstrip("/")
    if '2.0' == instance._api_version[API_NAME]:
        client = neutron_client(username=instance._username,
                                tenant_name=instance._tenant_name,
                                password=instance._password,
                                region_name=instance._region_name,
                                auth_url=instance._auth_url,
                                endpoint_url=url,
                                endpoint_type=instance._endpoint_type,
                                token=instance._token,
                                auth_strategy=instance._auth_strategy,
                                insecure=instance._insecure,
                                ca_cert=instance._ca_cert,
                                retries=instance._retries,
                                raise_errors=instance._raise_errors,
                                session=instance._session,
                                auth=instance._auth)
        return client
    else:
        raise exceptions.UnsupportedVersion(
            _("API version %s is not "
              "supported") % instance._api_version[API_NAME])
def make_client(instance):
    """Returns an neutron client."""
    neutron_client = utils.get_client_class(
        API_NAME,
        instance._api_version[API_NAME],
        API_VERSIONS,
    )
    instance.initialize()
    url = instance._url
    url = url.rstrip("/")
    client = neutron_client(username=instance._username,
                            tenant_name=instance._tenant_name,
                            password=instance._password,
                            region_name=instance._region_name,
                            auth_url=instance._auth_url,
                            endpoint_url=url,
                            endpoint_type=instance._endpoint_type,
                            token=instance._token,
                            auth_strategy=instance._auth_strategy,
                            insecure=instance._insecure,
                            ca_cert=instance._ca_cert,
                            retries=instance._retries,
                            raise_errors=instance._raise_errors,
                            session=instance._session,
                            auth=instance._auth)
    return client
def make_client(instance):
    """Returns an neutron client."""
    neutron_client = utils.get_client_class(
        API_NAME,
        instance._api_version[API_NAME],
        API_VERSIONS,
    )
    instance.initialize()
    url = instance._url
    url = url.rstrip("/")
    if '2.0' == instance._api_version[API_NAME]:
        client = neutron_client(username=instance._username,
                                tenant_name=instance._tenant_name,
                                password=instance._password,
                                region_name=instance._region_name,
                                auth_url=instance._auth_url,
                                auth_plugin=instance._auth_plugin,
                                endpoint_url=url,
                                endpoint_type=instance._endpoint_type,
                                token=instance._token,
                                auth_strategy=instance._auth_strategy,
                                insecure=instance._insecure,
                                ca_cert=instance._ca_cert,
                                retries=instance._retries,
                                raise_errors=instance._raise_errors,
                                session=instance._session,
                                auth=instance._auth)
        return client
    else:
        raise exceptions.UnsupportedVersion(_("API version %s is not "
                                              "supported") %
                                            instance._api_version[API_NAME])
Example #5
0
def make_client(instance):
    """Returns an neutron client."""
    neutron_client = utils.get_client_class(
        API_NAME,
        instance._api_version,
        API_VERSIONS,
    )
    instance.initialize()
    url = instance._url
    url = url.rstrip("/")
    client = neutron_client(username=instance._username,
                            project_name=instance._project_name,
                            password=instance._password,
                            region_name=instance._region_name,
                            auth_url=instance._auth_url,
                            endpoint_url=url,
                            endpoint_type=instance._endpoint_type,
                            token=instance._token,
                            auth_strategy=instance._auth_strategy,
                            insecure=instance._insecure,
                            ca_cert=instance._ca_cert,
                            retries=instance._retries,
                            raise_errors=instance._raise_errors,
                            session=instance._session,
                            auth=instance._auth)
    return client
def Client(api_version, *args, **kwargs):
    """Return an neutron client.
    @param api_version: only 2.0 is supported now
    """
    neutron_client = utils.get_client_class(
        API_NAME,
        api_version,
        API_VERSIONS,
    )
    return neutron_client(*args, **kwargs)
Example #7
0
def Client(api_version, *args, **kwargs):
    """Return an neutron client.
    @param api_version: only 2.0 is supported now
    """
    neutron_client = utils.get_client_class(
        API_NAME,
        api_version,
        API_VERSIONS,
    )
    return neutron_client(*args, **kwargs)