On Tue, Jan 12, 2016 at 8:13 AM, Tiago Delboni <delb...@gmail.com> wrote:

> UPDATE:
>
> We were able to build Ruby 2.1.7 on XP and run Puppet successfully with it.
> "
> However, we observed the same behaviour regarding accented characters in
> DisplayName: Puppet 3.8.4, even with Ruby 2.1.7, keeps installing the
> package on every run. :(
>
>

One thing to check is whether `puppet resource package` reports the same
name and version as what you're specifying in your manifest? If the name or
version don't match exactly, then puppet will think the package is not
installed, and will try to (re)install each time.

The next thing I'd try is to programmatically call puppet to get a package
listing. Run the "Start Command Prompt for Puppet" (as an administrator on
UAC systems), and execute the following:

C:\Windows\system32>irb
irb(main):001:0> require 'puppet'
=> true
irb(main):002:0> require 'puppet/type/package'
=> true
irb(main):003:0> require 'pp'
=> true
irb(main):004:0> pp Puppet::Type::Package::ProviderWindows.instances.map
{|provider| "#{provider.package.name}, #{provider.package.version}" }
["doxygen 1.8.8, 1.8.8",
 "Microsoft Visual J# 2.0 Redistributable Package - SE (x64), ",
 "Microsoft Windows SDK for Windows 7 (7.0), 7.0.7600.16385.40715",
 "Windows Azure Emulator - v2.2  \u2013  \u2013  \u2013, 2.2.6492.2",
 "NSClient++ (x64), 0.3.9.328",
  ...
]

More than likely you are running into yet another ruby registry bug that we
worked around in https://tickets.puppetlabs.com/browse/PUP-3837, The
particular issue is that calling Win32::Registry#each_key does not
correctly handle unicode. See
https://tickets.puppetlabs.com/browse/PUP-3837?focusedCommentId=131991&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-131991
for more details.


>
> Em segunda-feira, 11 de janeiro de 2016 14:28:11 UTC-2, Tiago Delboni
> escreveu:
>>
>> I was able to build Ruby 2.1.7 on XP using mingw32, along with the gems
>> listed in %ProgramFiles%\Puppet
>> Labs\Puppet\sys\ruby\lib\ruby\gems\1.9.0\gems
>> However, as I am illiterate on Ruby, I'm not sure I dealt properly with
>> the dependencies. Simply replacing %ProgramFiles%\Puppet
>> Labs\Puppet\sys\ruby with the new built does not work:
>>
>> C:\>puppet --version
>> C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/gems/2.1.0/gems/win32-security-0.3.2/lib/win32/security.rb:61:in
>> `block in elevated_security?': ParÔmetro incorreto. - GetTokenInformation
>> (SystemCallError)
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/gems/2.1.0/gems/win32-security-0.3.2/lib/win32/security.rb:41:in
>> `initialize'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/gems/2.1.0/gems/win32-security-0.3.2/lib/win32/security.rb:41:in
>> `new'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/gems/2.1.0/gems/win32-security-0.3.2/lib/win32/security.rb:41:in
>> `elevated_security?'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter/util/windows_root.rb:5:in `root?'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter/util/config.rb:41:in
>> `setup_default_ext_facts_dirs'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter/util/config.rb:69:in `<module:Config>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter/util/config.rb:5:in `<top (required)>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter/util/resolution.rb:2:in `<top (required)>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter/util/fact.rb:2:in `<top (required)>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter.rb:35:in `<module:Facter>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/facter/lib/facter.rb:30:in `<top (required)>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/puppet/lib/puppet.rb:6:in `<top (required)>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/puppet/lib/puppet/util/command_line.rb:12:in `<top (required)>'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/sys/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
>> `require'
>>         from C:/Arquivos de programas/Puppet
>> Labs/Puppet/puppet/bin/puppet:7:in `<main>'
>>
>> Em segunda-feira, 11 de janeiro de 2016 09:30:46 UTC-2, Tiago Delboni
>> escreveu:
>>>
>>> Hi Josh, thanks for the enlightenment!
>>> Any chances I can easily upgrade 3.8.x 's Ruby to fix this issue without
>>> breaking current manifests and behaviour?
>>>
>>> Em sexta-feira, 8 de janeiro de 2016 15:24:27 UTC-2, Josh Cooper
>>> escreveu:
>>>>
>>>>
>>>>
>>>> On Fri, Jan 8, 2016 at 8:20 AM, Tiago Delboni <del...@gmail.com> wrote:
>>>>
>>>>> With parser=future it doesn't complain about the escape sequence, but
>>>>> keeps creating the package every run. :(
>>>>>
>>>>> Copying the accented character to the manifest does not work (tried
>>>>> many ways).
>>>>>
>>>>>
>>>>> Em sexta-feira, 8 de janeiro de 2016 13:38:25 UTC-2, Henrik Lindberg
>>>>> escreveu:
>>>>>
>>>>>> On 2016-08-01 14:23, Tiago Delboni wrote:
>>>>>> > Hi!
>>>>>> >
>>>>>> > On Windows 7 we have Puppet 4.2.x and, in order to deal with
>>>>>> accented
>>>>>> > characters commonly found in registry key DisplayName, we use
>>>>>> unicode
>>>>>> > escape sequences in our manifests such as "\u00FA".
>>>>>> >
>>>>>> > However, on Windows XP,  we couldn't install Puppet 4.2.x so we use
>>>>>> > 3.8.x instead. When running the same manifest with escape
>>>>>> sequences,
>>>>>> > Puppet complains: "Unrecognised escape sequence '\u' in file ...".
>>>>>> >
>>>>>> Have you tried using 3.8.x with parser=future turned on? That would
>>>>>> give
>>>>>> you support for \u the same way as in puppet 4.x.
>>>>>>
>>>>>> > Puppet 3.8.x documentation states that it "treats strings as
>>>>>> sequences
>>>>>> > of bytes. It does not recognize encodings or translate between
>>>>>> them, and
>>>>>> > non-printing characters are preserved."
>>>>>> >
>>>>>> Yes, when you get the waring for \u, it means there will be a literal
>>>>>> backslash and a literal u in the resulting string. (That is with the
>>>>>> regular parser since it (as it says) does not support the \u escape
>>>>>> for
>>>>>> unicode chars).
>>>>>>
>>>>>> > So, how can I deal with software that have accented characters in
>>>>>> their
>>>>>> > DisplayName? Assuming that registry's encoding is the same on WXP
>>>>>> and
>>>>>> > W7, I could probably make it work by using Puppet 4.2.x on Windows
>>>>>> XP,
>>>>>> > but I just don't know how to install it successfully.
>>>>>> >
>>>>>>
>>>>>> Use puppet 3.8.x (latest) as noted above. The other approach (ugly,
>>>>>> and
>>>>>> horrible work around) is to simply copy/paste the actual character
>>>>>> into
>>>>>> the source file, but that is not guaranteed to work for all
>>>>>> characters.
>>>>>>
>>>>>> Hope that helps
>>>>>> - henrik
>>>>>>
>>>>>> > --
>>>>>> > 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 puppet-users...@googlegroups.com
>>>>>> > <mailto:puppet-users+unsubscr...@googlegroups.com>.
>>>>>> > To view this discussion on the web visit
>>>>>> >
>>>>>> https://groups.google.com/d/msgid/puppet-users/12713369-5970-4a43-804a-ca57a400afd0%40googlegroups.com
>>>>>> > <
>>>>>> https://groups.google.com/d/msgid/puppet-users/12713369-5970-4a43-804a-ca57a400afd0%40googlegroups..com?utm_medium=email&utm_source=footer>.
>>>>>>
>>>>>> > For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Visit my Blog "Puppet on the Edge"
>>>>>> http://puppet-on-the-edge.blogspot.se/
>>>>>>
>>>>>> --
>>>>> 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 puppet-users...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/puppet-users/6084ba68-3ac0-458a-ab7c-292d11663e6b%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/puppet-users/6084ba68-3ac0-458a-ab7c-292d11663e6b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> Puppet 3.8.x ships with ruby 1.9.3 (32-bit) and 2.0.0 (64-bit), both of
>>>> which use ANSI versions of Win32 registry APIs (and not the wide/unicode
>>>> versions). Puppet uses those methods to scan the registry looking for
>>>> installed applications, and is likely the cause for the problem you're
>>>> seeing. See
>>>> https://tickets.puppetlabs.com/browse/PUP-2937?focusedCommentId=87973&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-87973
>>>> for more information.
>>>>
>>>> Puppet 4.x ships with ruby 2.1.x, which switched to using wide versions
>>>> of the registry APIs, so I think that's why it's working in that case.
>>>>
>>>> Josh
>>>>
>>>> --
>>>> Josh Cooper
>>>> Developer, Puppet Labs
>>>>
>>> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/9a6efb8f-0347-4d1d-ac96-d72ef5f76b89%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/9a6efb8f-0347-4d1d-ac96-d72ef5f76b89%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Josh Cooper
Developer, Puppet Labs

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2Bu97u%3DAALp_kzzDi2TzQ2hzrWNGVAab2DWsxkotzm1N2QjCRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to