Exemplo n.º 1
0
    def _init_admin_ids(self):
        pr_cl = self.admin_mgr.projects_client
        rl_cl = self.admin_mgr.roles_v3_client
        rla_cl = self.admin_mgr.role_assignments_client
        us_cl = self.admin_mgr.users_v3_client

        project = identity.get_project_by_name(pr_cl,
                                               CONF.auth.admin_project_name)
        self.admin_project_id = project['id']
        user = identity.get_user_by_project(us_cl, rla_cl,
                                            self.admin_project_id,
                                            CONF.auth.admin_username)
        self.admin_id = user['id']

        roles = rl_cl.list_roles()['roles']
        for role in roles:
            if role['name'] == CONF.identity.admin_role:
                self.admin_role_id = role['id']
                break
Exemplo n.º 2
0
    def _init_admin_ids(self):
        pr_cl = self.admin_mgr.projects_client
        rl_cl = self.admin_mgr.roles_v3_client
        rla_cl = self.admin_mgr.role_assignments_client
        us_cl = self.admin_mgr.users_v3_client

        project = identity.get_project_by_name(pr_cl,
                                               CONF.auth.admin_project_name)
        self.admin_project_id = project['id']
        user = identity.get_user_by_project(us_cl, rla_cl,
                                            self.admin_project_id,
                                            CONF.auth.admin_username)
        self.admin_id = user['id']

        roles = rl_cl.list_roles()['roles']
        for role in roles:
            if role['name'] == CONF.identity.admin_role:
                self.admin_role_id = role['id']
                break