Example #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))
Example #2
0
def configure_loggers():
    # first off, configure defaults
    # to enable the use of the logger
    # even before the init was executed.
    _configure_defaults()

    from aria_cli import utils

    if utils.is_initialized():
        # init was already called
        # use the configuration file.
        _configure_from_file()

    global _lgr
    _lgr = logging.getLogger("aria_cli.cli.main")
Example #3
0
def configure_loggers():

    warnings.simplefilter(action='once', category=InsecurePlatformWarning)

    # first off, configure defaults
    # to enable the use of the logger
    # even before the init was executed.
    _configure_defaults()

    from aria_cli import utils
    if utils.is_initialized():
        # init was already called
        # use the configuration file.
        _configure_from_file()

    global _lgr
    _lgr = logging.getLogger('cloudify.cli.main')
Example #4
0
def configure_loggers():

    warnings.simplefilter(action='once', category=InsecurePlatformWarning)

    # first off, configure defaults
    # to enable the use of the logger
    # even before the init was executed.
    _configure_defaults()

    from aria_cli import utils
    if utils.is_initialized():
        # init was already called
        # use the configuration file.
        _configure_from_file()

    global _lgr
    _lgr = logging.getLogger('cloudify.cli.main')
Example #5
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))