本文整理汇总了Python中cfme.infrastructure.virtual_machines.Vm.create_on_provider方法的典型用法代码示例。如果您正苦于以下问题:Python Vm.create_on_provider方法的具体用法?Python Vm.create_on_provider怎么用?Python Vm.create_on_provider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.infrastructure.virtual_machines.Vm
的用法示例。
在下文中一共展示了Vm.create_on_provider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider_init, provider_crud, provider_mgmt, provider_data, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider_crud, template_name=provider_data['full_template']['name'])
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm
示例2: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider_init, provider_crud, provider_mgmt, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider_crud)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider()
return vm
示例3: test_vm_genealogy
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm_genealogy(
setup_provider, vm_name, provider_crud, provisioning, soft_assert, provider_mgmt, request):
"""Tests vm geneaology
Metadata:
test_flag: geneaology, provision
"""
original_template = provisioning["template"]
original_vm = Vm(vm_name, provider_crud, template_name=original_template)
original_vm.create_on_provider()
request.addfinalizer(
lambda: provider_mgmt.delete_vm(original_vm.name)
if provider_mgmt.does_vm_exist(original_vm.name) else None)
provider_mgmt.wait_vm_steady(original_vm.name)
first_template = original_vm.publish_to_template("{}x".format(vm_name))
soft_assert(isinstance(first_template, Template), "first_template is not a template!")
request.addfinalizer(
lambda: provider_mgmt.delete_vm(first_template.name)
if first_template.name in provider_mgmt.list_template() else None)
second_vm = Vm(
"{}x".format(first_template.name), provider_crud, template_name=first_template.name)
second_vm.create_on_provider()
request.addfinalizer(
lambda: provider_mgmt.delete_vm(second_vm.name)
if provider_mgmt.does_vm_exist(second_vm.name) else None)
soft_assert(isinstance(second_vm, Vm), "second_vm is a template!")
second_vm_ancestors = second_vm.genealogy.ancestors
# IT SEEMS IT "BREAKS" THE CHAIN WHEN THE VM IS CLONED TO A TEMPLATE
# soft_assert(original_vm.name in second_vm_ancestors, "{} is not in {}'s ancestors".format(
# original_vm.name, second_vm.name))
soft_assert(first_template.name in second_vm_ancestors, "{} is not in {}'s ancestors".format(
first_template.name, second_vm.name))
示例4: testing_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def testing_vm(request, vm_name, provider_init, provider_crud, provider_mgmt, provisioning):
vm_obj = Vm(vm_name, provider_crud, provisioning["template"])
def _finalize():
vm_obj.delete_from_provider()
request.addfinalizer(_finalize)
vm_obj.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm_obj
示例5: vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def vm(request, vm_template_name, vm_name, provider_crud, provider_mgmt):
logger.info("Starting vm fixture")
vm = Vm(vm_name, provider_crud, template_name=vm_template_name)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider(allow_skip="default")
request.addfinalizer(vm.delete_from_provider)
return vm
示例6: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider_crud, provider_mgmt, vm_name):
'''Fixture to provision appliance to the provider being tested if necessary'''
vm = Vm(vm_name, provider_crud)
request.addfinalizer(vm.delete_from_provider)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider()
return vm
示例7: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider_crud, provider_mgmt, vm_name, provider_init):
"""Fixture to provision appliance to the provider being tested if necessary"""
pytest.sel.force_navigate('infrastructure_providers')
vm = Vm(vm_name, provider_crud)
request.addfinalizer(vm.delete_from_provider)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider()
return vm
示例8: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider, vm_name, setup_provider_modscope):
"""Fixture to provision appliance to the provider being tested if necessary"""
pytest.sel.force_navigate('infrastructure_providers')
vm = Vm(vm_name, provider)
request.addfinalizer(vm.delete_from_provider)
if not provider.mgmt.does_vm_exist(vm_name):
vm.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm
示例9: testing_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def testing_vm(request, vm_name, provider_init, provider_crud, provider_mgmt, provisioning):
vm_obj = Vm(vm_name, provider_crud, provisioning["template"])
def _finalize():
vm_obj.delete_from_provider()
if vm_obj.does_vm_exist_in_cfme():
vm_obj.remove_from_cfme()
request.addfinalizer(_finalize)
vm_obj.create_on_provider()
provider_crud.refresh_provider_relationships()
wait_for(vm_obj.does_vm_exist_in_cfme, num_sec=450, delay=10)
return vm_obj
示例10: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider)
request.addfinalizer(vm.delete_from_provider)
if not provider.mgmt.does_vm_exist(vm_name):
logger.info("deploying {} on provider {}".format(vm_name, provider.key))
vm.create_on_provider(allow_skip="default")
else:
logger.info("recycling deployed vm {} on provider {}".format(vm_name, provider.key))
vm.provider_crud.refresh_provider_relationships()
vm.wait_to_appear()
return vm
示例11: testing_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def testing_vm(request, provisioning, provider_crud, provider_key):
setup_provider(provider_key)
vm = Vm(
name="test_ae_hd_{}".format(fauxfactory.gen_alphanumeric()),
provider_crud=provider_crud,
template_name=provisioning["template"]
)
def _finalize():
vm.delete_from_provider()
if vm.does_vm_exist_in_cfme():
vm.remove_from_cfme()
request.addfinalizer(_finalize)
vm.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm
示例12: testing_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def testing_vm(request, provisioning, provider_crud, provider_key):
setup_provider(provider_key)
vm = Vm(
name="test_ae_hd_{}".format(generate_random_string()),
provider_crud=provider_crud,
template_name=provisioning["template"]
)
def _finalize():
vm.delete_from_provider()
if vm.does_vm_exist_in_cfme():
vm.remove_from_cfme()
request.addfinalizer(_finalize)
vm.create_on_provider()
return vm
示例13: provision_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def provision_vm(request, provider_crud, provider_mgmt):
"""Function to provision appliance to the provider being tested"""
vm_name = "test_rest_db_" + fauxfactory.gen_alphanumeric()
vm = Vm(vm_name, provider_crud)
request.addfinalizer(vm.delete_from_provider)
if not provider_mgmt.does_vm_exist(vm_name):
logger.info("deploying {} on provider {}".format(vm_name, provider_crud.key))
vm.create_on_provider(allow_skip="default")
else:
logger.info("recycling deployed vm {} on provider {}".format(vm_name, provider_crud.key))
vm.provider_crud.refresh_provider_relationships()
vm.wait_to_appear()
return vm
示例14: test_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def test_vm(request, provider_crud, provider_mgmt, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider_crud)
logger.info("provider_key: {}".format(provider_crud.key))
def _cleanup():
vm.delete_from_provider()
if_scvmm_refresh_provider(provider_crud)
request.addfinalizer(_cleanup)
if not provider_mgmt.does_vm_exist(vm_name):
logger.info("deploying {} on provider {}".format(vm_name, provider_crud.key))
vm.create_on_provider()
else:
logger.info("recycling deployed vm {} on provider {}".format(vm_name, provider_crud.key))
vm.provider_crud.refresh_provider_relationships()
vm.wait_to_appear()
return vm
示例15: vmware_vm
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import create_on_provider [as 别名]
def vmware_vm(request, vmware_provider):
vm = Vm("test_control_{}".format(fauxfactory.gen_alpha().lower()), vmware_provider)
vm.create_on_provider(find_in_cfme=True)
request.addfinalizer(vm.delete_from_provider)
return vm