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)
导致以下错误:
BaseHTTPError: {"error": {"message": "get_version_v2() got an unexpected keyword argument 'auth'", "code": 400, "title": "Bad Request"}}
我还尝试从 url 中删除 v2.0 并添加 /tokens。两者都不起作用,它们会导致“找不到端点”错误。
我正在使用 vmware 集成的 OpenStack。