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()
Beispiel #2
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()
def enable_candu():
    try:
        original_roles = get_server_roles()
        new_roles = original_roles.copy()
        new_roles.update({
            'ems_metrics_coordinator': True,
            'ems_metrics_collector': True,
            'ems_metrics_processor': True,
            'automate': False,
            'smartstate': False})
        set_server_roles(**new_roles)
        candu.enable_all()
        yield
    finally:
        candu.disable_all()
        set_server_roles(**original_roles)
Beispiel #4
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()
Beispiel #5
0
def enable_candu():
    try:
        original_roles = get_server_roles()
        new_roles = original_roles.copy()
        new_roles.update({
            'ems_metrics_coordinator': True,
            'ems_metrics_collector': True,
            'ems_metrics_processor': True,
            'automate': False,
            'smartstate': False
        })
        set_server_roles(**new_roles)
        candu.enable_all()
        yield
    finally:
        candu.disable_all()
        set_server_roles(**original_roles)
Beispiel #6
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()
Beispiel #7
0
def enable_candu():
    # C&U data collection consumes a lot of memory and CPU.So, we are disabling some server roles
    # that are not needed for Chargeback reporting.
    original_roles = get_server_roles()
    new_roles = original_roles.copy()
    new_roles.update({
        'ems_metrics_coordinator': True,
        'ems_metrics_collector': True,
        'ems_metrics_processor': True,
        'automate': False,
        'smartstate': False})

    set_server_roles(**new_roles)
    candu.enable_all()

    yield

    set_server_roles(**original_roles)
    candu.disable_all()
def enable_candu(db):

    # C&U data collection consumes a lot of memory and CPU.So, we are disabling some server roles
    # that are not needed for Chargeback reporting.
    original_roles = get_server_roles()
    new_roles = original_roles.copy()
    new_roles.update({
        'ems_metrics_coordinator': True,
        'ems_metrics_collector': True,
        'ems_metrics_processor': True,
        'automate': False,
        'smartstate': False})

    set_server_roles(**new_roles)
    candu.enable_all()

    yield

    candu.disable_all()
    set_server_roles(**original_roles)
Beispiel #9
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()
Beispiel #10
0
def enable_candu():
    candu.enable_all()
Beispiel #11
0
def enable_candu():
    candu.enable_all()
def enable_candu():
    try:
        candu.enable_all()
        yield
    finally:
        candu.disable_all()