Beispiel #1
0
def setup_providers(validate=True, check_existing=True):
    """Run :py:func:`setup_provider` for every provider (cloud and infra)

    Args:
        validate: see description in :py:func:`setup_provider`
        check_existing: see description in :py:func:`setup_provider`

    Returns:
        A list of provider object for the created providers, cloud and infrastructure.

    """
    perflog.start('utils.providers.setup_providers')
    # Do cloud and infra separately to keep the browser navs down
    added_providers = []

    # Defer validation
    setup_kwargs = {'validate': False, 'check_existing': check_existing}
    added_providers.extend(setup_cloud_providers(**setup_kwargs))
    added_providers.extend(setup_infrastructure_providers(**setup_kwargs))

    if validate:
        map(methodcaller('validate'), added_providers)

    perflog.stop('utils.providers.setup_providers')

    return added_providers
Beispiel #2
0
def setup_providers(prov_classes=('cloud', 'infra'), validate=True, check_existing=True):
    """Run :py:func:`setup_provider` for every provider (cloud and infra only, by default)

    Args:
        prov_classes: list of provider classes to setup ('cloud', 'infra' and 'container')
        validate: see description in :py:func:`setup_provider`
        check_existing: see description in :py:func:`setup_provider`

    Returns:
        A list of provider object for the created providers, cloud and infrastructure.

    """
    perflog.start('utils.providers.setup_providers')
    # Do cloud and infra separately to keep the browser navs down
    added_providers = []

    # Defer validation
    setup_kwargs = {'validate': False, 'check_existing': check_existing}
    if 'cloud' in prov_classes:
        added_providers.extend(setup_cloud_providers(**setup_kwargs))
    if 'infra' in prov_classes:
        added_providers.extend(setup_infrastructure_providers(**setup_kwargs))
    if 'container' in prov_classes:
        added_providers.extend(setup_container_providers(**setup_kwargs))

    if validate:
        map(methodcaller('validate'), added_providers)

    perflog.stop('utils.providers.setup_providers')

    return added_providers
Beispiel #3
0
def setup_providers(prov_classes=('cloud', 'infra'), validate=True, check_existing=True):
    """Run :py:func:`setup_provider` for every provider (cloud and infra only, by default)

    Args:
        prov_classes: list of provider classes to setup ('cloud', 'infra' and 'container')
        validate: see description in :py:func:`setup_provider`
        check_existing: see description in :py:func:`setup_provider`

    Returns:
        A list of provider object for the created providers, cloud and infrastructure.

    """
    perflog.start('utils.providers.setup_providers')
    # Do cloud and infra separately to keep the browser navs down
    added_providers = []

    # Defer validation
    setup_kwargs = {'validate': False, 'check_existing': check_existing}
    if 'cloud' in prov_classes:
        added_providers.extend(setup_cloud_providers(**setup_kwargs))
    if 'infra' in prov_classes:
        added_providers.extend(setup_infrastructure_providers(**setup_kwargs))
    if 'container' in prov_classes:
        added_providers.extend(setup_container_providers(**setup_kwargs))
    if 'middleware' in prov_classes:
        added_providers.extend(setup_middleware_providers(**setup_kwargs))

    if validate:
        map(methodcaller('validate'), added_providers)

    perflog.stop('utils.providers.setup_providers')

    return added_providers
Beispiel #4
0
def setup_providers(validate=True, check_existing=True):
    """Run :py:func:`setup_provider` for every provider (cloud and infra)

    Args:
        validate: see description in :py:func:`setup_provider`
        check_existing: see description in :py:func:`setup_provider`

    Returns:
        A list of provider object for the created providers, cloud and infrastructure.

    """
    perflog.start('utils.providers.setup_providers')
    # Do cloud and infra separately to keep the browser navs down
    added_providers = []

    # Defer validation
    setup_kwargs = {'validate': False, 'check_existing': check_existing}
    added_providers.extend(setup_cloud_providers(**setup_kwargs))
    added_providers.extend(setup_infrastructure_providers(**setup_kwargs))

    if validate:
        map(methodcaller('validate'), added_providers)

    perflog.stop('utils.providers.setup_providers')

    return added_providers
Beispiel #5
0
def clear_providers():
    """Rudely clear all providers on an appliance

    Uses the UI in an attempt to cleanly delete the providers
    """
    # Executes the deletes first, then validates in a second pass
    logger.info('Destroying all appliance providers')
    perflog.start('utils.providers.clear_providers')
    clear_cloud_providers(validate=False)
    clear_infra_providers(validate=False)
    wait_for_no_cloud_providers()
    wait_for_no_cloud_providers()
    perflog.stop('utils.providers.clear_providers')
Beispiel #6
0
def clear_providers():
    """Rudely clear all providers on an appliance

    Uses the UI in an attempt to cleanly delete the providers
    """
    # Executes the deletes first, then validates in a second pass
    logger.info('Destroying all appliance providers')
    perflog.start('utils.providers.clear_providers')
    clear_cloud_providers(validate=False)
    clear_infra_providers(validate=False)
    wait_for_no_cloud_providers()
    wait_for_no_infra_providers()
    perflog.stop('utils.providers.clear_providers')
Beispiel #7
0
def clear_providers():
    """Rudely clear all providers on an appliance

    Uses the UI in an attempt to cleanly delete the providers
    """
    # Executes the deletes first, then validates in a second pass
    logger.info("Destroying all appliance providers")
    perflog.start("utils.providers.clear_providers")
    clear_cloud_providers(validate=False)
    clear_infra_providers(validate=False)
    if version.current_version() > "5.5":
        clear_container_providers(validate=False)
    wait_for_no_cloud_providers()
    wait_for_no_infra_providers()
    if version.current_version() > "5.5":
        wait_for_no_container_providers()
    perflog.stop("utils.providers.clear_providers")
Beispiel #8
0
def clear_providers():
    """Rudely clear all providers on an appliance

    Uses the UI in an attempt to cleanly delete the providers
    """
    # Executes the deletes first, then validates in a second pass
    logger.info('Destroying all appliance providers')
    perflog.start('utils.providers.clear_providers')
    clear_cloud_providers(validate=False)
    clear_infra_providers(validate=False)
    if version.current_version() > '5.5':
        clear_container_providers(validate=False)
    if version.current_version() == version.LATEST:
        clear_middleware_providers(validate=False)
    wait_for_no_cloud_providers()
    wait_for_no_infra_providers()
    if version.current_version() > '5.5':
        wait_for_no_container_providers()
    if version.current_version() == version.LATEST:
        wait_for_no_middleware_providers()
    perflog.stop('utils.providers.clear_providers')
Beispiel #9
0
def clear_providers():
    """Rudely clear all providers on an appliance

    Uses the UI in an attempt to cleanly delete the providers
    """
    # Executes the deletes first, then validates in a second pass
    logger.info('Destroying all appliance providers')
    perflog.start('utils.providers.clear_providers')
    clear_provider_by_type('cloud', validate=False)
    clear_provider_by_type('infra', validate=False)
    if version.current_version() > '5.5':
        clear_provider_by_type('container', validate=False)
    if version.current_version() == version.LATEST:
        clear_provider_by_type('middleware', validate=False)
    wait_for_no_providers_by_type('cloud')
    wait_for_no_providers_by_type('infra')
    if version.current_version() > '5.5':
        wait_for_no_providers_by_type('container')
    if version.current_version() == version.LATEST:
        wait_for_no_providers_by_type('middleware')
    perflog.stop('utils.providers.clear_providers')