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

fix --env does not override a node if environment is set to _default #237

Open
wilddog64 opened this issue Feb 13, 2015 · 0 comments
Open

Comments

@wilddog64
Copy link

when execute command fix --env staging nodes_with_role:my_role, if target node chef_environment is set to _default. It seems to me that the logic should be if name == '_default' and not littlechef.chef_environment == None ... to allow --env to override the default settings; or at least two should merge together

def get_environment(name):
"""Returns a JSON environment file as a dictionary"""
if name == "_default":
    return env_from_template(name)
filename = os.path.join("environments", name + ".json")
try:
    with open(filename) as f:
        try:
            return json.loads(f.read())
        except ValueError as e:
            msg = 'LittleChef found the following error in'
            msg += ' "{0}":\n                {1}'.format(filename, str(e))
            abort(msg)
except IOError:
    raise FileNotFoundError('File {0} not found'.format(filename))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant