Beispiel #1
0
def handle_render(args):
    config_filename = pathlib.Path(args.config)
    if not config_filename.is_file():
        raise ValueError(
            f"passed in configuration filename={config_filename} must exist")

    config = load_yaml(config_filename)

    verify(config)

    render_template(args.output, args.config, force=True)
Beispiel #2
0
def handle_force_destroy(args):
    config_filename = pathlib.Path(args.config)
    if not config_filename.is_file():
        raise ValueError(
            f"passed in configuration filename={config_filename} must exist")

    config = load_yaml(config_filename)

    # Don't verify(config) in case the schema has changed - just pick out the important bits and tear down

    force_destroy_configuration(config)
Beispiel #3
0
def handle_destroy(args):
    config_filename = pathlib.Path(args.config)
    if not config_filename.is_file():
        raise ValueError(
            f"passed in configuration filename={config_filename} must exist")

    config = load_yaml(config_filename)

    verify(config)

    if not args.disable_render:
        render_template(args.output, args.config, force=True)

    destroy_configuration(
        config,
        args.skip_remote_state_provision,
        args.full_only,
    )
Beispiel #4
0
def handle_validate(args):
    if args.configdeprecated and args.config:
        raise ValueError(
            "Please pass in -c/--config flag specifying your qhub-config.yaml file, and do NOT pass it as a standalone argument"
        )

    config_filename = args.config or args.configdeprecated
    if not config_filename:
        raise ValueError(
            "Please pass in a qhub-config.yaml filename using the -c/--config argument"
        )

    config_filename = pathlib.Path(args.config or args.configdeprecated)
    if not config_filename.is_file():
        raise ValueError(
            f"passed in configuration filename={config_filename} must exist")

    config = load_yaml(config_filename)

    if args.enable_commenting:
        # for PR's only
        comment_on_pr(config)
    else:
        verify(config)