当前位置: 首页>>代码示例>>Python>>正文


Python MyService.delete方法代码示例

本文整理汇总了Python中cfme.services.myservice.MyService.delete方法的典型用法代码示例。如果您正苦于以下问题:Python MyService.delete方法的具体用法?Python MyService.delete怎么用?Python MyService.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cfme.services.myservice.MyService的用法示例。


在下文中一共展示了MyService.delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _finalize

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
 def _finalize():
     _service = MyService(appliance, cat_item_name)
     if service_request.exists():
         service_request.wait_for_request()
         appliance.rest_api.collections.service_requests.action.delete(id=service_id.id)
     if _service.exists:
         _service.delete()
开发者ID:sbulage,项目名称:integration_tests,代码行数:9,代码来源:test_embedded_ansible_services.py

示例2: _finalize

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
 def _finalize():
     _service = MyService(appliance, cat_item_name)
     if service_request.exists():
         service_request.wait_for_request()
         service_request.remove_request()
     if _service.exists:
         _service.delete()
开发者ID:mkoura,项目名称:cfme_tests,代码行数:9,代码来源:test_embedded_ansible_services.py

示例3: service

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def service(appliance, ansible_catalog_item):
    _service = MyService(appliance, ansible_catalog_item.name)
    yield _service
    try:
        if _service.exists:
            _service.delete()
    except ItemNotFound:
        pass
开发者ID:apagac,项目名称:cfme_tests,代码行数:10,代码来源:test_embedded_ansible_automate.py

示例4: _cleanup

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def _cleanup(appliance=None, provision_request=None, service=None):
    if not service:
        last_message = provision_request.get_request_row_from_ui()['Last Message'].text
        service_name = last_message.split()[2].strip('[]')
        myservice = MyService(appliance, service_name)
    else:
        myservice = service
    if myservice.exists:
        myservice.delete()
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:11,代码来源:test_provision_stack.py

示例5: test_myservice_crud

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def test_myservice_crud(appliance, setup_provider, context, order_service):
    """Test Myservice crud in SSUI."""
    catalog_item = order_service
    with appliance.context.use(context):
        my_service = MyService(appliance, catalog_item.name)
        my_service.set_ownership("Administrator", "EvmGroup-approver")
        my_service.update({'description': '{}_edited'.format(catalog_item.name)})
        if appliance.version > "5.8":
            my_service.edit_tags("Cost Center", "Cost Center 001")
        my_service.delete()
开发者ID:LandoCalrizzian,项目名称:cfme_tests,代码行数:12,代码来源:test_ssui_myservice.py

示例6: order_ansible_service_in_ops_ui

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def order_ansible_service_in_ops_ui(appliance, ansible_catalog_item,
                                    ansible_service_catalog):
    """Tests if ansible playbook service provisioning is shown in service requests."""
    ansible_service_catalog.order()
    cat_item_name = ansible_catalog_item.name
    request_descr = "Provisioning Service [{0}] from [{0}]".format(cat_item_name)
    service_request = appliance.collections.requests.instantiate(description=request_descr)
    if service_request.exists():
        service_request.wait_for_request()
        service_request.remove_request()
    yield cat_item_name
    service = MyService(appliance, cat_item_name)
    if service.exists:
        service.delete()
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:16,代码来源:ansible_fixtures.py

示例7: test_crud_set_ownership_and_edit_tags

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def test_crud_set_ownership_and_edit_tags(appliance, context, myservice):
    """Tests my service crud , edit tags and ownership

    Metadata:
        test_flag: provision
    """

    service_name, vm_name = myservice
    with appliance.context.use(context):
        myservice = MyService(appliance, name=service_name, vm_name=vm_name)
        myservice.set_ownership("Administrator", "EvmGroup-administrator")
        myservice.add_tag("Cost Center *", "Cost Center 001")
        with update(myservice):
            myservice.description = "my edited description"
        myservice.delete()
开发者ID:akarol,项目名称:cfme_tests,代码行数:17,代码来源:test_myservice.py

示例8: test_myservice_crud

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def test_myservice_crud(appliance, setup_provider, context, order_service):
    """Test Myservice crud in SSUI.

    Metadata:
        test_flag: ssui, services

    Polarion:
        assignee: sshveta
        initialEstimate: 1/4h
    """
    catalog_item = order_service
    with appliance.context.use(context):
        my_service = MyService(appliance, catalog_item.name)
        my_service.set_ownership("Administrator", "EvmGroup-approver")
        my_service.update({'description': '{}_edited'.format(catalog_item.name)})
        my_service.edit_tags("Cost Center", "Cost Center 002")
        my_service.delete()
开发者ID:mkoura,项目名称:cfme_tests,代码行数:19,代码来源:test_ssui_myservice.py

示例9: myservice

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def myservice(setup_provider, provider, catalog_item, request):
    vm_name = catalog_item.provisioning_data["vm_name"]
    request.addfinalizer(lambda: cleanup_vm(vm_name + "_0001", provider))
    catalog_item.create()
    service_catalogs = ServiceCatalogs(catalog_item.name)
    service_catalogs.order()
    logger.info("Waiting for cfme provision request for service %s", catalog_item.name)
    row_description = catalog_item.name
    cells = {"Description": row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True], fail_func=requests.reload, num_sec=900, delay=20)
    assert row.request_state.text == "Finished"
    service = MyService(catalog_item.name, vm_name)
    yield service

    try:
        service.delete()
    except Exception as ex:
        logger.warning("Exception while deleting MyService, continuing: {}".format(ex.message))
开发者ID:ManageIQ,项目名称:integration_tests,代码行数:20,代码来源:test_add_remove_vm_to_service.py

示例10: myservice

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def myservice(appliance, provider, catalog_item, request):
    vm_name = catalog_item.prov_data["catalog"]["vm_name"]
    request.addfinalizer(lambda: VM.factory(vm_name + "_0001", provider).cleanup_on_provider())
    service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
    service_catalogs.order()
    logger.info('Waiting for cfme provision request for service %s', catalog_item.name)
    request_description = catalog_item.name
    provision_request = appliance.collections.requests.instantiate(request_description,
                                                                   partial_check=True)
    provision_request.wait_for_request()
    assert provision_request.is_finished()
    service = MyService(appliance, catalog_item.name, vm_name)
    yield service

    try:
        service.delete()
    except Exception as ex:
        logger.warning('Exception while deleting MyService, continuing: {}'.format(ex.message))
开发者ID:LandoCalrizzian,项目名称:cfme_tests,代码行数:20,代码来源:test_add_remove_vm_to_service.py

示例11: test_crud_set_ownership_and_edit_tags

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def test_crud_set_ownership_and_edit_tags(appliance, context, myservice):
    """Tests my service crud , edit tags and ownership

    Metadata:
        test_flag: provision

    Polarion:
        assignee: sshveta
        initialEstimate: 1/4h
    """

    service_name, vm_name = myservice
    with appliance.context.use(context):
        myservice = MyService(appliance, name=service_name, vm_name=vm_name)
        myservice.set_ownership("Administrator", "EvmGroup-administrator")
        myservice.add_tag()
        with update(myservice):
            myservice.description = "my edited description"
        myservice.delete()
开发者ID:mkoura,项目名称:cfme_tests,代码行数:21,代码来源:test_myservice.py

示例12: generic_service

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def generic_service(appliance, generic_catalog_item):
    """ This is global fixture to order generic service and return service and catalog item"""

    service_catalogs = ServiceCatalogs(
        appliance, catalog=generic_catalog_item.catalog, name=generic_catalog_item.name
    )
    provision_request = service_catalogs.order()
    logger.info("Waiting for service provision request for service %s", generic_catalog_item.name)
    provision_request.wait_for_request()

    if not provision_request.is_finished():
        pytest.skip("Failed to provision service '{}'".format(generic_catalog_item.name))

    service = MyService(appliance, generic_catalog_item.dialog.label)
    yield service, generic_catalog_item

    if service.exists:
        service.delete()
    if provision_request.exists:
        provision_request.remove_request(method="rest")
开发者ID:apagac,项目名称:cfme_tests,代码行数:22,代码来源:service_fixtures.py

示例13: service_vm

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def service_vm(appliance, provider, catalog_item):
    """ This is global fixture to get service and vm/instance provision by service."""

    collection = provider.appliance.provider_based_collection(provider)
    vm_name = "{}0001".format(catalog_item.prov_data["catalog"]["vm_name"])
    vm = collection.instantiate("{}0001".format(vm_name), provider)

    service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
    provision_request = service_catalogs.order()
    logger.info("Waiting for service provision request for service %s", catalog_item.name)
    provision_request.wait_for_request()

    if not provision_request.is_finished():
        pytest.skip("Failed to provision service '{}'".format(catalog_item.name))

    service = MyService(appliance, catalog_item.name, vm_name)
    yield service, vm

    vm.cleanup_on_provider()
    if service.exists:
        service.delete()
开发者ID:sbulage,项目名称:integration_tests,代码行数:23,代码来源:service_fixtures.py

示例14: order_service

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def order_service(appliance, provider, provisioning, vm_name, dialog, catalog, request):
    """ Orders service once the catalog item is created"""

    if hasattr(request, 'param'):
        param = request.param
        catalog_item = create_catalog_item(appliance, provider, provisioning,
                                           vm_name, dialog, catalog,
                                           console_test=True if 'console_test' in param else None)
    else:
        catalog_item = create_catalog_item(appliance, provider, provisioning,
                                           vm_name, dialog, catalog)
    service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
    provision_request = service_catalogs.order()
    provision_request.wait_for_request(method='ui')
    assert provision_request.is_succeeded()
    if provision_request.exists():
        provision_request.wait_for_request()
        provision_request.remove_request()
    yield catalog_item
    service = MyService(appliance, catalog_item.name)
    if service.exists:
        service.delete()
开发者ID:LandoCalrizzian,项目名称:cfme_tests,代码行数:24,代码来源:service_fixtures.py

示例15: order_service

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import delete [as 别名]
def order_service(appliance, provider, provisioning, dialog, catalog, request):
    """ Orders service once the catalog item is created"""

    if hasattr(request, 'param'):
        param = request.param
        catalog_item = create_catalog_item(appliance, provider, provisioning, dialog, catalog,
                                           console_test=True if 'console_test' in param else None)
    else:
        catalog_item = create_catalog_item(appliance, provider, provisioning, dialog, catalog)
    service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
    provision_request = service_catalogs.order()
    provision_request.wait_for_request(method='ui')
    assert provision_request.is_succeeded()
    if provision_request.exists():
        provision_request.wait_for_request()
        provision_request.remove_request()
    yield catalog_item
    service = MyService(appliance, catalog_item.name)
    if service.exists:
        service.delete()
    vm_name = '{}0001'.format(catalog_item.prov_data['catalog']['vm_name'])
    vm = appliance.collections.infra_vms.instantiate(vm_name, provider)
    vm.cleanup_on_provider()
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:25,代码来源:service_fixtures.py


注:本文中的cfme.services.myservice.MyService.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。