Ejemplo n.º 1
0
def generate_node_upgrade_script(installed_cluster_version,
                                 config_path=CONFIG_PATH):

    if installed_cluster_version is None:
        print('Must provide the version of the cluster upgrading from')
        return 1

    config = Config(config_path)
    try:
        gen_out = config_util.onprem_generate(config)
    except ValidationError as e:
        validation = normalize_config_validation_exception(e)
        print_messages(validation)
        return 1
    except ExhibitorTLSBootstrapError as e:
        log.error('Failed to bootstrap Exhibitor TLS')
        for i, error in enumerate(e.errors):
            return log.error("{}: {}".format(i + 1, error))
        return 1

    config_util.make_serve_dir(gen_out)

    # generate the upgrade script
    upgrade.generate_node_upgrade_script(gen_out, installed_cluster_version)

    return 0
Ejemplo n.º 2
0
def generate_node_upgrade_script(installed_cluster_version, config_path=CONFIG_PATH):

    if installed_cluster_version is None:
        print('Must provide the version of the cluster upgrading from')
        return 1

    config = Config(config_path)
    validation = validate_gen(config)
    if not validation:
        return 1
    gen_out = config_util.onprem_generate(config)
    config_util.make_serve_dir(gen_out)

    # generate the upgrade script
    upgrade.generate_node_upgrade_script(gen_out, installed_cluster_version)

    return 0
Ejemplo n.º 3
0
def generate_node_upgrade_script(installed_cluster_version,
                                 config_path=CONFIG_PATH):

    if installed_cluster_version is None:
        print('Must provide the version of the cluster upgrading from')
        return 1

    config = Config(config_path)
    validation = validate_gen(config)
    if not validation:
        return 1
    gen_out = config_util.onprem_generate(config)
    config_util.make_serve_dir(gen_out)

    # generate the upgrade script
    upgrade.generate_node_upgrade_script(gen_out, installed_cluster_version)

    return 0
Ejemplo n.º 4
0
def do_configure(config_path=CONFIG_PATH):
    """Returns error code

    :param config_path: path to config.yaml
    :type config_path: string | CONFIG_PATH (genconf/config.yaml)
    """
    config = Config(config_path)

    try:
        gen_out = config_util.onprem_generate(config)
    except ValidationError as e:
        validation = normalize_config_validation_exception(e)
        print_messages(validation)
        return 1

    config_util.make_serve_dir(gen_out)

    return 0
Ejemplo n.º 5
0
def do_configure(config_path=CONFIG_PATH):
    """Returns error code

    :param config_path: path to config.yaml
    :type config_path: string | CONFIG_PATH (genconf/config.yaml)
    """
    config = Config(config_path)

    try:
        gen_out = config_util.onprem_generate(config)
    except ValidationError as e:
        validation = normalize_config_validation_exception(e)
        print_messages(validation)
        return 1

    config_util.make_serve_dir(gen_out)

    return 0
Ejemplo n.º 6
0
def generate_node_upgrade_script(installed_cluster_version, config_path=CONFIG_PATH):

    if installed_cluster_version is None:
        print('Must provide the version of the cluster upgrading from')
        return 1

    config = Config(config_path)
    try:
        gen_out = config_util.onprem_generate(config)
    except ValidationError as e:
        validation = normalize_config_validation_exception(e)
        print_messages(validation)
        return 1

    config_util.make_serve_dir(gen_out)

    # generate the upgrade script
    upgrade.generate_node_upgrade_script(gen_out, installed_cluster_version)

    return 0
Ejemplo n.º 7
0
def generate_node_upgrade_script(installed_cluster_version, config_path=CONFIG_PATH):

    if installed_cluster_version is None:
        print('Must provide the version of the cluster upgrading from')
        return 1

    config = Config(config_path)
    try:
        gen_out = config_util.onprem_generate(config)
    except ValidationError as e:
        validation = normalize_config_validation_exception(e)
        print_messages(validation)
        return 1

    config_util.make_serve_dir(gen_out)

    # generate the upgrade script
    upgrade.generate_node_upgrade_script(gen_out, installed_cluster_version)

    return 0
Ejemplo n.º 8
0
def do_configure(config_path=CONFIG_PATH):
    """Returns error code

    :param config_path: path to config.yaml
    :type config_path: string | CONFIG_PATH (genconf/config.yaml)
    """
    config = Config(config_path)

    try:
        gen_out = config_util.onprem_generate(config)
    except ValidationError as e:
        validation = normalize_config_validation_exception(e)
        print_messages(validation)
        return 1
    except ExhibitorTLSBootstrapError as e:
        log.error('Failed to bootstrap Exhibitor TLS')
        for i, error in enumerate(e.errors):
            return log.error("{}: {}".format(i + 1, error))
        return 1
    config_util.make_serve_dir(gen_out)

    return 0