Actions
Bug #19215
closedExample[String[0], Array[String]] data type parsed as a single argument
Description
When specifying the following data type in a class parameter, the third argument is being ignored:
Variant[Undef, String[0], Array[Stdlib::Absolutepath]] $server_common_modules_path,
This can be seen from the parameter validation error when using an array, as Kafo only permits it to be an Undef or zero-length string:
Parameter puppet-server-common-modules-path invalid: ["/etc/puppetlabs/code/environments/common", "/etc/puppetlabs/code/modules", "/opt/puppetlabs/puppet/modules"] is not one of undef or string
A minimised test case is this data type:
Hash[String[0], Array[String]]
which is parsed incorrectly:
$ irb -Ilib -rkafo/data_type > Kafo::DataType.new_from_string('Hash[String[0], Array[String]]') => #<Kafo::DataTypes::Hash:0x00000001967980 @inner_key_type=#<Kafo::DataTypes::String:0x00000001967458 @min=0, @max=:infinite>, @inner_value_type=#<Kafo::DataTypes::Any:0x00000001966328>, @min=0, @max=:infinite> > Kafo::DataType.new_from_string('Hash[String, Array[String]]') => #<Kafo::DataTypes::Hash:0x00000001937b90 @inner_key_type=#<Kafo::DataTypes::String:0x000000019379b0 @min=0, @max=:infinite>, @inner_value_type=#<Kafo::DataTypes::Array:0x000000019374b0 @inner_type=#<Kafo::DataTypes::String:0x00000001937398 @min=0, @max=:infinite>, @min=0, @max=:infinite>, @min=0, @max=:infinite>
(the inner_value_type is set to "Any" when String[0]
is used for the hash key type)
Updated by The Foreman Bot about 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/kafo/pull/212 added
Updated by Dominic Cleal about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 86f29674479c4c5634a892dcc79a06f75e635786.
Actions