Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @validation.required_openstack(admin=True)
- @scenario.configure(context={"admin_cleanup": ["keystone"]})
- def project_admin_is_cloud_admin(self, **kwargs):
- admin = self.admin_clients("keystone", version=3)
- new_domain = admin.domains.create("domain-1")
- print new_domain.id
- new_domain_admin = admin.users.create(
- name="user-1", password="password", domain=new_domain.id)
- admin_role = admin.roles.find(name="admin")
- admin.roles.grant(admin_role, user=new_domain_admin, domain=new_domain)
- from keystoneauth1.identity import v3 as id_v3
- auth = id_v3.Password(user_domain_name="domain-1", username="user-1", domain_name="domain-1", password="password", project_domain_name="domain-1", auth_url=self.admin_clients("keystone", version=3).auth_url)
- from keystoneauth1 import session
- from keystoneclient.v3 import client
- sess = session.Session(auth=auth)
- keystone = client.Client(session=sess)
- print keystone
- keystone.projects.create('test', domain='default')
- print admin.projects.list()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement