I have some code that is similar to this in the F5 and Netscaler modules. I make a generic "truthy" property that accepts various truthy/falsy values ( https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/property/netscaler_truthy.rb) then just define that as the parent of the property ( https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/type/netscaler_csvserver.rb#L73-L75 )
On Mon, Nov 2, 2015 at 12:06 PM Cody Herriges <c...@puppetlabs.com> wrote: > Sofer Athlan-Guyot wrote: > > Hi, > > > > The idea would be to have some of the types defined oslo config > > > http://git.openstack.org/cgit/openstack/oslo.config/tree/oslo_config/types.py > > ported to puppet type. Those that looks like good candidates are: > > - Boolean; > > - IPAddress; > > and in a lesser extend: > > - Integer; > > - Float; > > > > For instance in puppet type requiring a Boolean, we may test > > "/[tT]rue|[fF]alse/", but the real thing is : > > > > TRUE_VALUES = ['true', '1', 'on', 'yes'] > > FALSE_VALUES = ['false', '0', 'off', 'no'] > > > > Good idea. I'd only add that we should convert 'true' and 'false' to > real booleans for Puppet's purposes since the Puppet language is now typed. > > -- > Cody > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev >
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev