On Sunday, January 24, 2016 at 12:15:32 PM UTC-6, Matt Watson wrote:
>
> Hey guys,
>
> I recently came up against an error in 4.3.1 where versioncmp() seems to
> be broken:
>
> Debug: Performing a hiera indirector lookup of lookup_options with options
> {:variables=>Scope(Class[Role::Gr01]),
> :merge=>#<Puppet::Pops::HashMergeStrategy:0x00000004d5b728
> @options_t=#<Puppet::Pops::Types::PStructType:0x00000004d57cb8
> @elements=[#<Puppet::Pops::Types::PStructElement:0x00000004d57ce0
> @key_type=#<Puppet::Pops::Types::POptionalType:0x00000004d57d08
> @optional_type=#<Puppet::Pops::Types::PStringType:0x00000004d57d58
> @size_type=nil, @values=["strategy"]>>,
> @value_type=#<Puppet::Pops::Types::POptionalType:0x00000004d57e48
> @optional_type=#<Puppet::Pops::Types::PPatternType:0x00000004d57e70
> @patterns=[#<Puppet::Pops::Types::PRegexpType:0x00000004d57f88
> @pattern="hash", @regexp=/hash/>]>>>]>, @options={}>}
>
>
I fail to see why the log output you presented makes you think there is
anything wrong with versioncmp(), nor indeed that there is any problem at
all. It's merely a debug-level message, which you should be able to
suppress by turning off debug-level logging at the master. There is not
even any reason to suppose that the message was emitted in the context of a
call to versioncmp(). I do see similar debug messages in the log output in
the description of issue PUP-5721, but they are not characteristic of any
error there, either. The issue is not about them.
The issues you linked seem to derive from versioncmp() requiring both its
arguments to be strings. There's nothing new or unusual about that. The
underlying problem in both cases may be one of wrong expectations. For
example, the (standard) DSL evaluator in Puppet 3 and earlier automatically
interpreted absence of a value (which can be spelled "undef") as an empty
string in some contexts where doing so is questionable. Code that depends
on that behavior will not work in Puppet 4 (or in Puppet 3 with
parser=future) because the new evaluator preserves undef wherever it can
do, so as to avoid losing information. Indeed, the new evaluator is
overall much more attentive to data types than the old one is.
If indeed you do have a problem, not just a debug message, then we may be
able to help you, but it is difficult to give you any specific advice when
you present neither the DSL code that exhibits the problem nor the error
message that Puppet emits.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/30bed461-f2b9-475d-bd11-e0bad7af39bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.