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']

all this being case insensitive.

This can lead to discrepancies when checking if the resource is in_sync
for instance, as it could be saved as "1" and we would check for "true".

IPAddress could/should be use in puppet-neutron for instance to catch
problems earlier.

Eventually, this would be a library of types that could be included,
using a mixin in any type/provider and that would define the:
 - is_sync;
 - validate;
 - newparam;

Something like:

  newproperty(:gateway_ip) do
    include Puppet_X::Openstack::Types::IPAdrress
  end

Float and Integer are very easy to make and I put them for completeness.

Any other types could be included there as well.

This point was raised during the last meeting[1] 

[1] 
http://eavesdrop.openstack.org/meetings/puppet_openstack/2015/puppet_openstack.2015-10-13-15.00.html
-- 
Sofer Athlan-Guyot

__________________________________________________________________________
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

Reply via email to