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

Mixlib config should have default validation checking #26

Open
mmzyk opened this issue Mar 20, 2015 · 1 comment
Open

Mixlib config should have default validation checking #26

mmzyk opened this issue Mar 20, 2015 · 1 comment
Labels
Type: Enhancement Adds new functionality.

Comments

@mmzyk
Copy link

mmzyk commented Mar 20, 2015

It should be possible to state the valid values for a config option and check that either the default value is used or that the option supplied is valid.

This would avoid issues such as the one seen here chef/chef#1509 where cookbook_path was set to nil leading to odd errors.

@KierranM
Copy link
Contributor

Would it also be useful to be able to specify whether a config option is required? I'm picturing a similar system as how attributes are defined in a Chef cookbook LWRP:

require 'mixlib/config'

class ValidatedConfig
  # something like this?
  configurable('string').required.is_a(String)
end

@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants