Skip to content

cannot have value which evaluates to false #98

Description

@TimSimpsonR

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"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions