Ejemplo n.º 1
0
def init(blueprint_path,
         inputs,
         install_plugins_):
    if os.path.isdir(_storage_dir()):
        shutil.rmtree(_storage_dir())

    if not utils.is_initialized():
        aria.init(reset_config=False, skip_logging=True)
    try:
        common.initialize_blueprint(
            blueprint_path=blueprint_path,
            name=_NAME,
            inputs=inputs,
            storage=_storage(),
            install_plugins=install_plugins_,
            resolver=utils.get_import_resolver()
        )
    except ImportError as e:
        e.possible_solutions = [
            "Run 'aria init --install-plugins -p {0}'"
            .format(blueprint_path),
            "Run 'aria install-plugins -p {0}'"
            .format(blueprint_path)
        ]
        raise

    logger.get_logger().info(
        "Initiated {0}\nIf you make changes to the "
        "blueprint, "
        "Run 'aria init -p {0}' "
        "again to apply them"
        .format(blueprint_path))
Ejemplo n.º 2
0
def init(blueprint_path,
         inputs,
         install_plugins_):
    if os.path.isdir(_storage_dir()):
        shutil.rmtree(_storage_dir())

    if not utils.is_initialized():
        aria_init.init(reset_config=False, skip_logging=True)
    try:
        common.initialize_blueprint(
            blueprint_path=blueprint_path,
            name=_NAME,
            inputs=inputs,
            storage=_storage(),
            install_plugins=install_plugins_,
            resolver=utils.get_import_resolver()
        )
    except ImportError as e:

        # import error indicates
        # some plugin modules are missing
        # TODO - consider adding an error code to
        # TODO - all of our exceptions. so that we
        # TODO - easily identify them here
        e.possible_solutions = [
            "Run 'aria init --install-plugins -p {0}'"
            .format(blueprint_path),
            "Run 'aria install-plugins -p {0}'"
            .format(blueprint_path)
        ]
        raise

    get_logger().info("Initiated {0}\nIf you make changes to the "
                      "blueprint, "
                      "run 'aria init -p {0}' "
                      "again to apply them"
                      .format(blueprint_path))