[openstack-dev] [puppet] Match type checking from oslo.config.

Hunter Haugen hunter at puppetlabs.com
Tue Nov 3 16:21:01 UTC 2015


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 <cody at 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-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151103/3058b6d0/attachment.html>


More information about the OpenStack-dev mailing list