Hi all,

we are trying to use libcloud to boot VMs on various clouds, openstack based,
but also commercial. We use libcloud-2.4.0.

With one of our openstack clouds, we have a problem with authentication.

These variables are defined and unset in the openstack RC file:

export OS_AUTH_URL=https://<ourcloud>:5000/v3
export OS_PROJECT_ID=522d5924d2844e1b811f77ddd94eab1d
export OS_PROJECT_NAME="Services"
export OS_USER_DOMAIN_NAME="ABCD"
export OS_PROJECT_DOMAIN_ID="default"
unset OS_TENANT_ID
unset OS_TENANT_NAME
export OS_USERNAME="ouruser"
read -sr OS_PASSWORD_INPUT
export OS_PASSWORD=$OS_PASSWORD_INPUT
export OS_REGION_NAME="RegionOne"
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3

The problem seems to be the user domain here, which in our case now seems to
collide with the project domain name.

We are using this code

from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver


from libcloud.common.openstack_identity import OpenStackIdentity_3_0_Connection
from libcloud.common.openstack_identity import OpenStackIdentityTokenScope


OpenStack = get_driver(Provider.OPENSTACK)
driver = OpenStack('ouruser', <password>,
                   ex_domain_name = "ABCD",
                   ex_tenant_name = "Services",
                   ex_token_scope = "project",
ex_force_auth_url='https://<ourcloud>:5000',
                   ex_force_auth_version='3.x_password')

# print(driver.list_supported_versions())
print(driver.list_nodes())


We are getting this error:

$ python3 ./test.py
Traceback (most recent call last):
  File "./test.py", line 18, in <module>
    print(driver.list_nodes())
  File "/usr/local/lib/python3.5/dist-packages/libcloud/compute/drivers/openstack.py", line 191, in list_nodes
    self.connection.request('/servers/detail', params=params).object)
  File "/usr/local/lib/python3.5/dist-packages/libcloud/common/openstack.py", line 224, in request
    raw=raw)
  File "/usr/local/lib/python3.5/dist-packages/libcloud/common/base.py", line 535, in request
    action = self.morph_action_hook(action)
  File "/usr/local/lib/python3.5/dist-packages/libcloud/common/openstack.py", line 291, in morph_action_hook
    self._populate_hosts_and_request_paths()
  File "/usr/local/lib/python3.5/dist-packages/libcloud/common/openstack.py", line 325, in _populate_hosts_and_request_paths
    osa = osa.authenticate(**kwargs)  # may throw InvalidCreds
  File "/usr/local/lib/python3.5/dist-packages/libcloud/common/openstack_identity.py", line 1048, in authenticate
    raise InvalidCredsError()
libcloud.common.types.InvalidCredsError: 'Invalid credentials with the provider'

Any hints ? It appears that "ABCD" shows now up as project name as well as user domain name.

Thanks, Rolf

Reply via email to