当前位置: 首页>>代码示例>>Python>>正文


Python Repo.list方法代码示例

本文整理汇总了Python中pulp_auto.repo.Repo.list方法的典型用法代码示例。如果您正苦于以下问题:Python Repo.list方法的具体用法?Python Repo.list怎么用?Python Repo.list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pulp_auto.repo.Repo的用法示例。


在下文中一共展示了Repo.list方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_02_check_role_permission

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
    def test_02_check_role_permission(self):
        # create users
        self.user.create(self.pulp)
        self.assertPulpOK()

        self.user2.create(self.pulp)
        self.assertPulpOK()

        # add users to the role
        self.role.add_user(
            self.pulp,
            data={'login': self.user.data['login']}
        )
        self.assertPulp(code=200)

        self.role.add_user(
            self.pulp,
            data={'login': self.user2.data['login']}
        )
        self.assertPulp(code=200)

        # check users' permissions
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)

        with self.user_pulp2.asserting(True):
            Repo.list(self.user_pulp2)
开发者ID:alexxa,项目名称:pulp-automation,代码行数:29,代码来源:test_8_role_permissions.py

示例2: test_04_check_role_permission

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
    def test_04_check_role_permission(self):
        # create users
        self.user.create(self.pulp)
        self.assertPulpOK()

        self.user2.create(self.pulp)
        self.assertPulpOK()

        # add users to the role
        self.role.add_user(
            self.pulp,
            self.user.id
        )
        self.assertPulp(code=200)

        self.role.add_user(
            self.pulp,
            self.user2.id
        )
        self.assertPulp(code=200)

        # check users' permissions, that thay can access resource after been added to specific role
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)

        with self.user_pulp2.asserting(True):
            Repo.list(self.user_pulp2)
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:29,代码来源:test_08_role_permissions.py

示例3: test_15_check_bindings_removed

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_15_check_bindings_removed(self):
     self.role.delete(self.pulp)
     self.assertPulpOK()
     #check that after role deletion user binding are also removed
     with self.assertRaises(AssertionError):
         with self.user_pulp.asserting(True):
             Repo.list(self.user_pulp)
开发者ID:lenfree,项目名称:pulp-automation,代码行数:9,代码来源:test_6_roles.py

示例4: test_99_node_unbind_repo

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_99_node_unbind_repo(self):
     self.node.unbind_repo(self.pulp, self.repo.id, self.node_distributor.id)
     self.assertPulpOK()
     # nodes keep the repos after updating
     child_repos = Repo.list(self.pulp_child)
     for repo in child_repos:
         Task.wait_for_report(self.pulp_child, repo.delete(self.pulp_child))
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:9,代码来源:test_01_cud.py

示例5: test_11_two_roles_two_users

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
    def test_11_two_roles_two_users(self):
        # create users
        self.user.create(self.pulp)
        self.assertPulpOK()

        self.user2.create(self.pulp)
        self.assertPulpOK()

        # grant permissions
        self.role.grant_permission(self.pulp, self.role.id, "/", ["READ", "EXECUTE"])
        self.role.grant_permission(self.pulp, self.role.id, "/repositories/", ["READ", "EXECUTE"])
        self.assertPulpOK()

        self.role2.grant_permission(self.pulp, self.role2.id, "/", ["READ", "EXECUTE"])
        self.role2.grant_permission(self.pulp, self.role2.id, "/repositories/", ["READ", "EXECUTE"])
        self.assertPulpOK()

        # add users to roles
        self.role.add_user(
            self.pulp,
            self.user.id
        )
        self.assertPulp(code=200)

        self.role2.add_user(
            self.pulp,
            self.user.id
        )
        self.assertPulp(code=200)

        self.role2.add_user(
            self.pulp,
            self.user2.id
        )
        self.assertPulp(code=200)

        # check users' permissions
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)

        with self.user_pulp2.asserting(True):
            Repo.list(self.user_pulp2)

        # revoke permissions from role2
        self.role2.revoke_permission(self.pulp, self.role2.id, "/", ["READ", "EXECUTE"])
        self.role2.revoke_permission(self.pulp, self.role2.id, "/repositories/", ["READ", "EXECUTE"])
        self.assertPulpOK()

        # check users' permissions
        # user should still be able to access resource as it belongs to other role
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)
        # user2 should not be able to access resource as no more pemissions are granted to it
        with self.assertRaises(AssertionError):
            with self.user_pulp2.asserting(True):
                Repo.list(self.user_pulp2)
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:58,代码来源:test_08_role_permissions.py

示例6: test_06_two_roles_two_users

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
    def test_06_two_roles_two_users(self):
        # create users
        self.user.create(self.pulp)
        self.assertPulpOK()

        self.user2.create(self.pulp)
        self.assertPulpOK()

        # grant permissions
        self.role.grant_permission(self.pulp, data={"role_id": self.role.data['id'], "resource": "/", "operations": ["READ", "EXECUTE"]})
        self.role.grant_permission(self.pulp, data={"role_id": self.role.data['id'], "resource": "/repositories/", "operations": ["READ", "EXECUTE"]})
        self.assertPulpOK()

        self.role2.grant_permission(self.pulp, data={"role_id": self.role2.data['id'], "resource": "/", "operations": ["READ", "EXECUTE"]})
        self.role2.grant_permission(self.pulp, data={"role_id": self.role2.data['id'], "resource": "/repositories/", "operations": ["READ", "EXECUTE"]})
        self.assertPulpOK()

        # add users to roles
        self.role.add_user(
            self.pulp,
            data={'login': self.user.data['login']}
        )
        self.assertPulp(code=200)

        self.role2.add_user(
            self.pulp,
            data={'login': self.user.data['login']}
        )
        self.assertPulp(code=200)

        self.role2.add_user(
            self.pulp,
            data={'login': self.user2.data['login']}
        )
        self.assertPulp(code=200)

        # check users' permissions
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)

        with self.user_pulp2.asserting(True):
            Repo.list(self.user_pulp2)

        # revoke permissions from role2
        self.role2.revoke_permission(self.pulp, data={"role_id": self.role2.data['id'], "resource": "/", "operations": ["READ", "EXECUTE"]})
        self.role2.revoke_permission(self.pulp, data={"role_id": self.role2.data['id'], "resource": "/repositories/", "operations": ["READ", "EXECUTE"]})
        self.assertPulpOK()

        # check users' permissions
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)

        with self.assertRaises(AssertionError):
            with self.user_pulp2.asserting(True):
                Repo.list(self.user_pulp2)
开发者ID:alexxa,项目名称:pulp-automation,代码行数:57,代码来源:test_8_role_permissions.py

示例7: test_03_list_repos

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_03_list_repos(self):
     repos = Repo.list(self.pulp)
     self.assertIn(self.repo, repos)
开发者ID:alexxa,项目名称:pulp-automation,代码行数:5,代码来源:test_15_iso_repo.py

示例8: test_07_check_role_permission

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_07_check_role_permission(self):
     # check that user cannot access resource as permissions of the role were revoked
     with self.assertRaises(AssertionError):
         with self.user_pulp.asserting(True):
             Repo.list(self.user_pulp)
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:7,代码来源:test_08_role_permissions.py

示例9: test_03_check_user_permission

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_03_check_user_permission(self):
     #check that user can access resource on which permissions were granted
     with self.user_pulp.asserting(True):
         Repo.list(self.user_pulp)
开发者ID:jeremycline,项目名称:pulp-automation,代码行数:6,代码来源:test_7_user_permissions.py

示例10: test_05_child_repo_list

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_05_child_repo_list(self):
     # at this point the repo should be visible on both the nodes
     assert self.repo in Repo.list(self.pulp_child), 'repo not propagated to child node'
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:5,代码来源:test_01_cud.py

示例11: test_14_check_bindings_removed

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
 def test_14_check_bindings_removed(self):
     #check that after user2 removal from role user binding are also removed
     with self.assertRaises(AssertionError):
         with self.user_pulp2.asserting(True):
             Repo.list(self.user_pulp2)
开发者ID:lenfree,项目名称:pulp-automation,代码行数:7,代码来源:test_6_roles.py

示例12: test_12_check_user_perm

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import list [as 别名]
    def test_12_check_user_perm(self):
        with self.user_pulp.asserting(True):
            Repo.list(self.user_pulp)

        with self.user_pulp2.asserting(True):
            Repo.list(self.user_pulp2)
开发者ID:lenfree,项目名称:pulp-automation,代码行数:8,代码来源:test_6_roles.py


注:本文中的pulp_auto.repo.Repo.list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。