<div dir="ltr">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 (<a href="https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/property/netscaler_truthy.rb">https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/property/netscaler_truthy.rb</a>) then just define that as the parent of the property (<a href="https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/type/netscaler_csvserver.rb#L73-L75">https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/type/netscaler_csvserver.rb#L73-L75</a>)</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 2, 2015 at 12:06 PM Cody Herriges <<a href="mailto:cody@puppetlabs.com">cody@puppetlabs.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sofer Athlan-Guyot wrote:<br>
> Hi,<br>
><br>
> The idea would be to have some of the types defined oslo config<br>
> <a href="http://git.openstack.org/cgit/openstack/oslo.config/tree/oslo_config/types.py" rel="noreferrer" target="_blank">http://git.openstack.org/cgit/openstack/oslo.config/tree/oslo_config/types.py</a><br>
> ported to puppet type.  Those that looks like good candidates are:<br>
>  - Boolean;<br>
>  - IPAddress;<br>
> and in a lesser extend:<br>
>  - Integer;<br>
>  - Float;<br>
><br>
> For instance in puppet type requiring a Boolean, we may test<br>
> "/[tT]rue|[fF]alse/", but the real thing is :<br>
><br>
>     TRUE_VALUES = ['true', '1', 'on', 'yes']<br>
>     FALSE_VALUES = ['false', '0', 'off', 'no']<br>
><br>
<br>
Good idea.  I'd only add that we should convert 'true' and 'false' to<br>
real booleans for Puppet's purposes since the Puppet language is now typed.<br>
<br>
--<br>
Cody<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div>