Skip to content

Empty environment variable and empty yaml key behave differently #296

@rngadam

Description

@rngadam

configargparse v1.7

usage

given this add_argument:

        parser.add_argument(
            "--accept-taa",
            type=str,
            nargs=2,
            metavar=("<acceptance-mechanism>", "<taa-version>"),
            env_var="ACAPY_ACCEPT_TAA",
            help=(
                "Specify the acceptance mechanism and taa version for which to accept"
                " the transaction author agreement. If not provided, the TAA must"
                " be accepted through the TTY or the admin API."
            ),
        )

yaml

given this yaml file:

accept-taa: 

value is not set and is ignored

yaml

given this environment variable (loaded with docker --env-file):

ACAPY_ACCEPT_TAA=

exception:

error: argument --accept-taa: expected 2 arguments

expected

empty environment variable same behavior as no value yaml; if value-less and expect a value, just treat it as not specified

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions