1.编写cinderclient.py文件:
from keystoneauth1.identity import v3
from keystoneauth1 import session
from cinderclient.v2 import client as c
auth_info = {
"user_domain_name": "Default",
"username": "admin",
"password": "admin",
"auth_url": "http://192.168.10.4:35357/v3/",
"project_name": "admin",
"project_domain_name": "Default"
}
auth = v3.Password(**auth_info)
sess = session.Session(auth=auth)
client = c.Client(session=sess)
2.运行python
3.输入如下
from cinderclient2 import client
client.quotas.get("admin")._info
client.quotas.update("admin",**quota_)