本文整理汇总了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)
示例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)
示例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)
示例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))
示例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)
示例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)
示例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)
示例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)
示例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)
示例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'
示例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)
示例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)