chef / mixlib-config

A simple class based Config mechanism, similar to the one found in Chef
http://www.chef.io
Apache License 2.0
51 stars 36 forks source link

Mixlib config should have default validation checking #26

Open mmzyk opened 9 years ago

mmzyk commented 9 years ago

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 https://github.com/chef/chef/issues/1509 where cookbook_path was set to nil leading to odd errors.

KierranM commented 8 years ago

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