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

cannot have value which evaluates to false #98

Open
TimSimpsonR opened this issue Feb 26, 2019 · 0 comments
Open

cannot have value which evaluates to false #98

TimSimpsonR opened this issue Feb 26, 2019 · 0 comments

Comments

@TimSimpsonR
Copy link

I tried to create a config value that was null in stages where a feature wasn't used. This does not seem to be possible as at some point fleece evaluates the value for a given stage, and if it's false for any reason raises an error. Here's the stack trace:

  config-value:
    +development: ""
    +staging: false
    +production: :decrypt:ABCDEF9876543210
    +/.*/: null

null, "", and false all show an error like the following

Traceback (most recent call last):
  File "/Users/tim.simpson/.local/bin/fleece", line 11, in <module>
    sys.exit(main())
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/main.py", line 37, in main
    getattr(module, 'main')(sys.argv[2:])
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/config/config.py", line 460, in main
    parsed_args.func(parsed_args)
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/config/config.py", line 343, in render_config
    stages, config = _read_config_file(args)
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/config/config.py", line 272, in _read_config_file
    render=True)
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/config/config.py", line 192, in _decrypt_item
    data = _decrypt_dict(data, stage=stage, key=key, render=render)
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/config/config.py", line 213, in _decrypt_dict
    render=render)
  File "/Users/tim.simpson/.local/venvs/fleece/lib/python3.6/site-packages/fleece/cli/config/config.py", line 190, in _decrypt_item
    '"{}"'.format(key, stage))
ValueError: Key "config-value" has no value for stage "timsimpsonr"
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