Example #1
0
def register_configs():
    pack_dir = cfg.CONF.register.pack
    fail_on_failure = cfg.CONF.register.fail_on_failure

    registered_count = 0

    try:
        LOG.info("=========================================================")
        LOG.info("############## Registering configs ######################")
        LOG.info("=========================================================")
        registered_count = configs_registrar.register_configs(pack_dir=pack_dir, fail_on_failure=fail_on_failure)
    except Exception as e:
        exc_info = not fail_on_failure
        LOG.warning("Failed to register configs: %s", e, exc_info=exc_info)

        if fail_on_failure:
            raise e

    LOG.info("Registered %s configs." % (registered_count))
Example #2
0
def register_configs():
    pack_dir = cfg.CONF.register.pack
    fail_on_failure = cfg.CONF.register.fail_on_failure

    registered_count = 0

    try:
        LOG.info('=========================================================')
        LOG.info('############## Registering configs ######################')
        LOG.info('=========================================================')
        registered_count = configs_registrar.register_configs(
            pack_dir=pack_dir, fail_on_failure=fail_on_failure)
    except Exception as e:
        exc_info = not fail_on_failure
        LOG.warning('Failed to register configs: %s', e, exc_info=exc_info)

        if fail_on_failure:
            raise e

    LOG.info('Registered %s configs.' % (registered_count))
Example #3
0
def register_configs():
    pack_dir = cfg.CONF.register.pack
    fail_on_failure = not cfg.CONF.register.no_fail_on_failure

    registered_count = 0

    try:
        LOG.info('=========================================================')
        LOG.info('############## Registering configs ######################')
        LOG.info('=========================================================')
        registered_count = configs_registrar.register_configs(pack_dir=pack_dir,
                                                              fail_on_failure=fail_on_failure,
                                                              validate_configs=True)
    except Exception as e:
        exc_info = not fail_on_failure
        LOG.warning('Failed to register configs: %s', e, exc_info=exc_info)

        if fail_on_failure:
            raise e

    LOG.info('Registered %s configs.' % (registered_count))
Example #4
0
def register_configs():
    pack_dir = cfg.CONF.register.pack
    fail_on_failure = not cfg.CONF.register.no_fail_on_failure

    registered_count = 0

    try:
        LOG.info('=========================================================')
        LOG.info('############## Registering configs ######################')
        LOG.info('=========================================================')
        with Timer(key='st2.register.configs'):
            registered_count = configs_registrar.register_configs(
                pack_dir=pack_dir,
                fail_on_failure=fail_on_failure,
                validate_configs=True)
    except Exception as e:
        exc_info = not fail_on_failure
        LOG.warning('Failed to register configs: %s', e, exc_info=exc_info)

        if fail_on_failure:
            raise e

    LOG.info('Registered %s configs.' % (registered_count))
Example #5
0
def register_configs():
    pack_dir = cfg.CONF.register.pack
    fail_on_failure = not cfg.CONF.register.no_fail_on_failure

    registered_count = 0

    try:
        LOG.info("=========================================================")
        LOG.info("############## Registering configs ######################")
        LOG.info("=========================================================")
        with Timer(key="st2.register.configs"):
            registered_count = configs_registrar.register_configs(
                pack_dir=pack_dir,
                fail_on_failure=fail_on_failure,
                validate_configs=True,
            )
    except Exception as e:
        exc_info = not fail_on_failure
        LOG.warning("Failed to register configs: %s", e, exc_info=exc_info)

        if fail_on_failure:
            raise e

    LOG.info("Registered %s configs." % (registered_count))