當前位置: 首頁>>代碼示例>>Python>>正文


Python Vm.wait_to_appear方法代碼示例

本文整理匯總了Python中cfme.infrastructure.virtual_machines.Vm.wait_to_appear方法的典型用法代碼示例。如果您正苦於以下問題:Python Vm.wait_to_appear方法的具體用法?Python Vm.wait_to_appear怎麽用?Python Vm.wait_to_appear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cfme.infrastructure.virtual_machines.Vm的用法示例。


在下文中一共展示了Vm.wait_to_appear方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: fleecing_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [as 別名]
def fleecing_vm(
        request, compliance_vm, vm_analysis, provider_mgmt, provider_key, provider_crud,
        analysis_profile):
    logger.info("Provisioning an appliance for fleecing on {}".format(provider_key))
    # TODO: When we get something smaller, use it!
    appliance = provision_appliance(
        vm_name_prefix=PREFIX + "for_fleece_",
        version=str(version.current_version()),
        provider_name=provider_key)
    request.addfinalizer(lambda: diaper(appliance.destroy))
    logger.info("Appliance {} provisioned".format(appliance.vm_name))
    vm = Vm(appliance.vm_name, provider_crud)
    provider_crud.refresh_provider_relationships()
    vm.wait_to_appear()
    # Assign the analysis profile
    action = Action(
        "Assign analysis profile {}".format(analysis_profile.name),
        "Assign Profile to Analysis Task",
        dict(analysis_profile=analysis_profile.name))
    action.create()
    request.addfinalizer(action.delete)
    policy = VMControlPolicy("Analysis profile policy {}".format(generate_random_string()))
    policy.create()
    request.addfinalizer(policy.delete)
    policy.assign_actions_to_event("VM Analysis Start", action)
    analysis_pp = PolicyProfile(
        "Analysis profile PP {}".format(generate_random_string()),
        policies=[policy])
    analysis_pp.create()
    request.addfinalizer(analysis_pp.delete)
    vm.assign_policy_profiles(analysis_pp.description)
    request.addfinalizer(lambda: vm.unassign_policy_profiles(analysis_pp.description))
    return vm
開發者ID:petrblaho,項目名稱:cfme_tests,代碼行數:35,代碼來源:test_compliance.py

示例2: compliance_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [as 別名]
def compliance_vm(request, provider_key, provider_crud):
    try:
        ip_addr = re.findall(r'[0-9]+(?:\.[0-9]+){3}', store.base_url)[0]
        appl_name = provider_crud.get_mgmt_system().get_vm_name_from_ip(ip_addr)
        appliance = Appliance(provider_key, appl_name)
        logger.info(
            "The tested appliance ({}) is already on this provider ({}) so reusing it.".format(
                appl_name, provider_key))
        appliance.configure_fleecing()
        vm = Vm(appl_name, provider_crud)
    except VmNotFoundViaIP:
        logger.info("Provisioning a new appliance on provider {}.".format(provider_key))
        appliance = provision_appliance(
            vm_name_prefix=PREFIX + "host_",
            version=str(version.current_version()),
            provider_name=provider_key)
        request.addfinalizer(lambda: diaper(appliance.destroy))
        appliance.configure(setup_fleece=True)
        vm = Vm(appliance.vm_name, provider_crud)
    # Do the final touches
    with appliance.ipapp(browser_steal=True) as appl:
        appl.set_session_timeout(86400)
        provider_crud.refresh_provider_relationships()
        vm.wait_to_appear()
        vm.load_details()
        wait_for_ssa_enabled()
        yield vm
開發者ID:petrblaho,項目名稱:cfme_tests,代碼行數:29,代碼來源:test_compliance.py

示例3: test_no_dvd_ruins_refresh

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [as 別名]
def test_no_dvd_ruins_refresh(provider, small_template):
    host_group = provider.data["provisioning"]["host_group"]
    with provider.mgmt.with_vm(
            small_template, vm_name="test_no_dvd_{}".format(fauxfactory.gen_alpha()),
            host_group=host_group) as vm_name:
        provider.mgmt.disconnect_dvd_drives(vm_name)
        vm = Vm(vm_name, provider)
        provider.refresh_provider_relationships()
        vm.wait_to_appear()
開發者ID:richardfontana,項目名稱:cfme_tests,代碼行數:11,代碼來源:test_scvmm_specific.py

示例4: fleecing_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [as 別名]
def fleecing_vm(request, compliance_vm, vm_analysis, provider_mgmt, provider_key, provider_crud, analysis_profile):
    logger.info("Provisioning an appliance for fleecing on {}".format(provider_key))
    # TODO: When we get something smaller, use it!
    appliance = provision_appliance(
        vm_name_prefix=PREFIX + "for_fleece_", version=str(version.current_version()), provider_name=provider_key
    )
    request.addfinalizer(lambda: diaper(appliance.destroy))
    logger.info("Appliance {} provisioned".format(appliance.vm_name))
    vm = Vm(appliance.vm_name, provider_crud)
    provider_crud.refresh_provider_relationships()
    vm.wait_to_appear()
    return vm
開發者ID:seandst,項目名稱:cfme_tests,代碼行數:14,代碼來源:test_compliance.py

示例5: test_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [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
開發者ID:richardfontana,項目名稱:cfme_tests,代碼行數:16,代碼來源:test_appliance_replication.py

示例6: provision_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [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
開發者ID:richardfontana,項目名稱:cfme_tests,代碼行數:17,代碼來源:test_db_restore.py

示例7: test_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [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
開發者ID:petrblaho,項目名稱:cfme_tests,代碼行數:21,代碼來源:test_vm_power_control.py

示例8: compliance_vm

# 需要導入模塊: from cfme.infrastructure.virtual_machines import Vm [as 別名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import wait_to_appear [as 別名]
def compliance_vm(request, provider):
    try:
        ip_addr = urlparse(store.base_url).hostname
        appl_name = provider.mgmt.get_vm_name_from_ip(ip_addr)
        appliance = Appliance(provider.key, appl_name)
        logger.info(
            "The tested appliance ({}) is already on this provider ({}) so reusing it.".format(
                appl_name, provider.key))
        try:
            appliance.configure_fleecing()
        except (EOFError, ApplianceException) as e:
            # If something was happening, restart and wait for the UI to reappear to prevent errors
            appliance.ipapp.reboot()
            pytest.skip(
                "Error during appliance configuration. Skipping:\n{}: {}".format(
                    type(e).__name__, str(e)))
        vm = Vm(appl_name, provider)
    except VmNotFoundViaIP:
        logger.info("Provisioning a new appliance on provider {}.".format(provider.key))
        appliance = provision_appliance(
            vm_name_prefix=PREFIX + "host_",
            version=str(version.current_version()),
            provider_name=provider.key)
        request.addfinalizer(lambda: diaper(appliance.destroy))
        try:
            appliance.configure(setup_fleece=True)
        except (EOFError, ApplianceException) as e:   # Add known exceptions as needed.
            pytest.skip(
                "Error during appliance configuration. Skipping:\n{}: {}".format(
                    type(e).__name__, str(e)))
        vm = Vm(appliance.vm_name, provider)
    if provider.type in {"rhevm"}:
        request.addfinalizer(appliance.remove_rhev_direct_lun_disk)
    # Do the final touches
    with appliance.ipapp(browser_steal=True) as appl:
        appl.set_session_timeout(86400)
        provider.refresh_provider_relationships()
        vm.wait_to_appear()
        vm.load_details()
        wait_for_ssa_enabled()
        yield vm
開發者ID:richardfontana,項目名稱:cfme_tests,代碼行數:43,代碼來源:test_compliance.py


注:本文中的cfme.infrastructure.virtual_machines.Vm.wait_to_appear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。