Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have get_configs respect required/optional args #15

Open
snobear opened this issue Aug 19, 2014 · 0 comments
Open

have get_configs respect required/optional args #15

snobear opened this issue Aug 19, 2014 · 0 comments
Assignees
Labels

Comments

@snobear
Copy link
Owner

snobear commented Aug 19, 2014

The get_configs function in ezmomi.py merges the config.yml settings with settings supplied on the command line (argparse).

Currently, ezmomi complains if any parameter has not been set on the command line or in the config file, even if its been marked as required=False in params.py. We want it to ignore any optional arguments.

Here's the relevant bits:

        # Check all required values were supplied either via command line
        # or config. override defaults from config.yml with any supplied
        # command line arguments
        notset = list()
        for key, value in kwargs.items():
            if value:
                config[key] = value
            elif (value is None) and (key not in config):
                # compile list of parameters that were not set
                notset.append(key)

        if notset:
            print "Required parameters not set: %s\n" % notset
            sys.exit(1)
@snobear snobear added the bug label Aug 19, 2014
@snobear snobear self-assigned this Aug 19, 2014
@snobear snobear changed the title have get_configs respect required/option args have get_configs respect required/optional args Aug 19, 2014
snobear added a commit that referenced this issue Aug 20, 2014
snobear added a commit that referenced this issue Aug 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant