本文整理匯總了Python中robottelo.cli.contenthost.ContentHost.list方法的典型用法代碼示例。如果您正苦於以下問題:Python ContentHost.list方法的具體用法?Python ContentHost.list怎麽用?Python ContentHost.list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類robottelo.cli.contenthost.ContentHost
的用法示例。
在下文中一共展示了ContentHost.list方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_positive_unregister
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import list [as 別名]
def test_positive_unregister(self):
"""Unregister Content host
@feature: Content host
@assert: After unregistering, Content hosts list for the org does not
show the Content host
"""
activation_key = make_activation_key({
'content-view-id': self.PROMOTED_CV['id'],
'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
'organization-id': self.NEW_ORG['id'],
})
with VirtualMachine(distro='rhel71') as client:
client.install_katello_ca()
client.register_contenthost(
activation_key['name'],
self.NEW_ORG['label'],
)
result = ContentHost.list({'organization-id': self.NEW_ORG['id']})
self.assertGreaterEqual(len(result), 1)
self.assertIn(client.hostname, [chost['name'] for chost in result])
result = client.run('subscription-manager unregister')
self.assertEqual(result.return_code, 0)
result = ContentHost.list({'organization-id': self.NEW_ORG['id']})
self.assertNotIn(
client.hostname, [chost['name'] for chost in result])
示例2: test_positive_list
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import list [as 別名]
def test_positive_list(self):
"""List Content hosts for a given org
@id: b9c056cd-11ca-4870-bac4-0ebc4a782cb0
@Assert: Content hosts are listed for the given org
@CaseLevel: System
"""
activation_key = make_activation_key({
'content-view-id': self.PROMOTED_CV['id'],
'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
'organization-id': self.NEW_ORG['id'],
})
with VirtualMachine(distro='rhel71') as client:
client.install_katello_ca()
client.register_contenthost(
activation_key['name'],
self.NEW_ORG['label'],
)
result = ContentHost.list({
'organization-id': self.NEW_ORG['id'],
'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
})
self.assertGreaterEqual(len(result), 1)
self.assertIn(client.hostname, [chost['name'] for chost in result])
示例3: test_positive_list
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import list [as 別名]
def test_positive_list(self):
"""List Content hosts for a given org
@feature: Content host
@assert: Content hosts are listed for the given org
"""
activation_key = make_activation_key(
{
"content-view-id": self.PROMOTED_CV["id"],
"lifecycle-environment-id": self.NEW_LIFECYCLE["id"],
"organization-id": self.NEW_ORG["id"],
}
)
with VirtualMachine(distro="rhel71") as client:
client.install_katello_ca()
client.register_contenthost(activation_key["name"], self.NEW_ORG["label"])
result = ContentHost.list({"organization-id": self.NEW_ORG["id"]})
self.assertGreaterEqual(len(result), 1)
self.assertIn(client.hostname, [chost["name"] for chost in result])