Skip to content

(#9461) 'puppet resource package' fails on Windows #128

Closed
ChaseMotorman wants to merge 2 commits intopuppetlabs:2.7.xfrom
ChaseMotorman:ticket/2.7.x/9491-windows-package-failure
Closed

(#9461) 'puppet resource package' fails on Windows #128
ChaseMotorman wants to merge 2 commits intopuppetlabs:2.7.xfrom
ChaseMotorman:ticket/2.7.x/9491-windows-package-failure

Conversation

@ChaseMotorman
Copy link
Copy Markdown
Contributor

This commit corrects a basic failure to enumerate package resources
on Windows. In previous versions, 'package' enumeration failed due to
the provider subsystem's inability to exec any process neccesary to
do the enumerations.

The general fix expands the Puppet::Util.which command when running
on Windows to search for EXE variants if the target is not found.
For example, a search for 'gem' fails, because 'gem' (like all other
Ruby and Puppet binaries) is wrapped in a batch file, creating 'gem.bat'.

If a lookup fails on Windows, and the passed value doesn't contain a file
extension, 'which' will examine the value of the environment 'PATHEXT'
setting, which contains a delimited list of known extensions. 'which'
will append each extension to the value (in order of appearance) and
reevaluate. If no PATHEXT value exists, the code defaiults to the
basic Windows binary extensions (.bat;.ps1;.exe;.com). The first match
found wins, and the translated value is cached against future lookups.

Spec tests have been updated to reflect this change.

(#9607) MSI provider fails to enumerate instances

The second, specific change corrects resource enumeration in the Windows
MSI provider. Installed MSI package state files were not examined for
the required 'source' value. This commit now examines the YAML state
file, caches the yaml object, and adds a get-method to return the
'source' value. The 'package' type base class was also fixed to only
validate source properties for providers that extend the 'source' method.

Spec tests have been updated to reflect new and fixed code.

Depends on resolution #9461:puppet resource package' fails on Windows

Cameron Thomas added 2 commits September 20, 2011 15:42
This commit corrects a basic failure to enumerate package resources
on Windows. In previous versions, 'package' enumeration failed due to
the provider subsystem's inability to exec any process neccesary to
do the enumerations.

The general fix expands the Puppet::Util.which command when running
on Windows to search for EXE variants if the target is not found.
For example, a search for 'gem' fails, because 'gem' (like all other
Ruby and Puppet binaries) is wrapped in a batch file, creating 'gem.bat'.

If a lookup fails on Windows, and the passed value doesn't contain a file
extension, 'which' will examine the value of the environment 'PATHEXT'
setting, which contains a delimited list of known extensions. 'which'
will append each extension to the value (in order of appearance) and
reevaluate. If no PATHEXT value exists, the code defaiults to the
basic Windows binary extensions (.bat;.ps1;.exe;.com). The first match
found wins, and the translated value is cached against future lookups.

Spec tests have been updated to reflect this change.
The second, specific change corrects resource enumeration in the Windows
MSI provider. Installed MSI package state files were not examined for
the required 'source' value. This commit now examines the YAML state
file, caches the yaml object, and adds a get-method to return the
'source' value. The 'package' type base class was also fixed to only
validate source properties for providers that extend the 'source' method.

Spec tests have been updated to reflect new and fixed code.

Depends on resolution #9461:puppet resource package' fails on Windows
@joshcooper
Copy link
Copy Markdown
Contributor

Superceded by #158

@joshcooper joshcooper closed this Oct 7, 2011
melissa pushed a commit to melissa/puppet that referenced this pull request Mar 30, 2018
(maint) Remove facter include / lib dependency from CMakeLists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants