本文整理匯總了Python中revizor2.api.Farm.clear_roles方法的典型用法代碼示例。如果您正苦於以下問題:Python Farm.clear_roles方法的具體用法?Python Farm.clear_roles怎麽用?Python Farm.clear_roles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類revizor2.api.Farm
的用法示例。
在下文中一共展示了Farm.clear_roles方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_rebundle_cloudinit_server
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import clear_roles [as 別名]
def test_rebundle_cloudinit_server(self, context: dict, cloud: Cloud, farm: Farm, servers: dict):
"""Verify cloudinit server rebundling work"""
bundle_id = rebundle.start_server_rebundle(servers['M1'])
rebundle.assert_bundle_task_created(servers['M1'], bundle_id)
role_id = rebundle.wait_bundle_complete(servers['M1'], bundle_id)
farm.clear_roles()
lib_farm.add_role_to_farm(context, farm, role=Role.get(role_id))
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lifecycle.assert_szr_version_last(server)
lib_server.assert_scalarizr_log_errors(cloud, server)
示例2: test_server_rebundle
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import clear_roles [as 別名]
def test_server_rebundle(self, context: dict, cloud: Cloud, farm: Farm):
"""Verify server rebundle work"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm)
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
bundle_id = rebundle.start_server_rebundle(server)
rebundle.assert_bundle_task_created(server, bundle_id)
new_role_id = rebundle.wait_bundle_complete(server, bundle_id)
farm.clear_roles()
lib_farm.add_role_to_farm(context, farm, role=Role.get(new_role_id))
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lifecycle.assert_szr_version_last(server)
lib_server.assert_scalarizr_log_errors(cloud, server)