发起问题

Revision history [back]

click to hide/show revision 1
初始版本

通过python sdk调用openstack api 报错

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

auth_username = 'admin' 
auth_password = 'admin_pass' 
auth_url = 'http://200.21.40.62:5000/v2.0/' 
project_name = 'admin' 
region_name = ''

provider = get_driver(Provider.OPENSTACK) 
conn = provider(auth_username, 
                auth_password, 
                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 i in images: 
    print(i)

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