Пример #1
0
def enable_candu():
    try:
        with server_roles_enabled(
                'ems_metrics_coordinator', 'ems_metrics_collector', 'ems_metrics_processor'):
            candu.enable_all()
            yield
    finally:
        candu.disable_all()
Пример #2
0
def setup_candu():
    candu = CANDUCollection()
    candu.enable_all()
    with server_roles_enabled('ems_metrics_coordinator',
                              'ems_metrics_collector',
                              'ems_metrics_processor'):
        yield
    candu.disable_all()
Пример #3
0
def enable_candu():
    try:
        with server_roles_enabled('ems_metrics_coordinator',
                                  'ems_metrics_collector',
                                  'ems_metrics_processor'):
            candu.enable_all()
            yield
    finally:
        candu.disable_all()
Пример #4
0
def enable_candu(appliance):
    candu = appliance.get(CANDUCollection)
    try:
        with server_roles_enabled('ems_metrics_coordinator',
                                  'ems_metrics_collector',
                                  'ems_metrics_processor'):
            candu.enable_all()
            yield
    finally:
        candu.disable_all()
Пример #5
0
def configure_websocket():
    """
    Enable websocket role if it is disabled.

    Currently the fixture cfme/fixtures/base.py,
    disables the websocket role to avoid intrusive popups.
    """
    with configuration.server_roles_enabled('websocket'):
        logger.info('Enabling the websocket role to allow console connections')
        yield
    logger.info('Disabling the websocket role to avoid intrusive popups')
Пример #6
0
def initialize_provider(provider):
    # Remove all providers
    BaseProvider.clear_providers()
    # Setup the provider we want
    provider.create(validate_credentials=True, validate_inventory=True, check_existing=True)
    # Take care of C&U settings
    if provider.type not in CANDU_PROVIDER_TYPES:
        yield provider
    else:
        try:
            with server_roles_enabled(
                    'ems_metrics_coordinator', 'ems_metrics_collector', 'ems_metrics_processor'):
                candu.enable_all()
                yield provider
        finally:
            candu.disable_all()
Пример #7
0
def initialize_provider(provider, setup_provider_modscope):
    # Remove other providers
    for provider_key in existing_providers():
        if provider_key == provider.key:
            continue
        provider_to_delete = get_crud(provider_key)
        if provider_to_delete.exists:
            provider_to_delete.delete(cancel=False)
    # Take care of C&U settings
    if provider.type not in CANDU_PROVIDER_TYPES:
        yield provider
    else:
        try:
            with server_roles_enabled(
                    'ems_metrics_coordinator', 'ems_metrics_collector', 'ems_metrics_processor'):
                candu.enable_all()
                yield provider
        finally:
            candu.disable_all()
Пример #8
0
def initialize_provider(provider, setup_provider_modscope):
    # Remove other providers
    for provider_key in existing_providers():
        if provider_key == provider.key:
            continue
        provider_to_delete = get_crud(provider_key)
        if provider_to_delete.exists:
            provider_to_delete.delete(cancel=False)
    # Take care of C&U settings
    if provider.type not in CANDU_PROVIDER_TYPES:
        yield provider
    else:
        try:
            with server_roles_enabled('ems_metrics_coordinator',
                                      'ems_metrics_collector',
                                      'ems_metrics_processor'):
                candu.enable_all()
                yield provider
        finally:
            candu.disable_all()