Esempio n. 1
0
def init(reset_config, skip_logging=False):
    if os.path.exists(os.path.join(
            os.getcwd(),
            constants.ARIA_WD_SETTINGS_DIRECTORY_NAME,
            constants.ARIA_WD_SETTINGS_FILE_NAME)):
        if not reset_config:
            msg = 'Current directory is already initialized'
            error = exceptions.AriaError(msg)
            error.possible_solutions = [
                "Run 'aria init -b [blueprint-id] -p [path-to-a-blueprint]' "
                "to force re-initialization "
                "(might overwrite existing "
                "configuration files if exist)"
            ]
            raise error
        else:
            shutil.rmtree(os.path.join(
                os.getcwd(),
                constants.ARIA_WD_SETTINGS_DIRECTORY_NAME))

    settings = utils.AriaWorkingDirectorySettings()
    utils.dump_aria_working_dir_settings(settings)
    utils.dump_configuration_file()
    logger.configure_loggers('aria_cli.cli.main')
    if not skip_logging:
        logger.get_logger().info('Initialization completed successfully')
Esempio n. 2
0
def _configure_loggers():
    from aria_core import logger
    logger.configure_loggers('aria_cli.cli.main')