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

import libcloud.security

auth_usr   = 'ryan@ccc.sss.com'
auth_pass  = '*********'
auth_url   = 'https://ccc.sss.com:5000/v2.0'
project_name = 'POC'
region_name = ''

libcloud.security.VERIFY_SSL_CERT = False

provider = get_driver(Provider.OPENSTACK)
conn = provider(auth_usr,
                auth_pass,
                ex_force_auth_url=auth_url,
                ex_force_auth_version='2.0_password',
                ex_tenant_name=project_name,
                ex_force_service_region=region_name)

images = conn.list_images()

for image in images:
    print(image)

Results in the following error:

BaseHTTPError: {"error": {"message": "get_version_v2() got an unexpected keyword argument 'auth'", "code": 400, "title": "Bad Request"}}

I've also tried stripping the v2.0 from the url and also adding /tokens. Neither work, and they result in a "cannot find endpoint" error.

I'm using vmware integrated OpenStack.

Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
Ryan
  • 219
  • 3
  • 12
  • curl -X POST -i -k -H "Content-Type: application/json" -d "{\"auth\": { \"passwordCredentials\": { \"password\": \"*******\", \"username\": \"ryan@ccc.sss.com\" }, \"tenantName\": \"POC\" } }" https://ccc.sss.com:5000/v2.0/tokens Works :/ but if i use the /tokens in the libcloud example i get no endpoint – Ryan Dec 10 '15 at 13:41

1 Answers1

0

OK turns out in my case that you need to set the region to "nova" for it to work.

ex_force_service_region="nova"

I had to trace through the code in pyDev to determine that it was the region not matching that was the issue.

Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
Ryan
  • 219
  • 3
  • 12