Windows Pathnames with spaces in Puppet file directive

595 views
Skip to first unread message

wernerbahlke

unread,
May 17, 2013, 9:28:20 AM5/17/13
to puppet...@googlegroups.com

I have to change a file in c:\Program Files <x86>\MSBuild\Microsoft.Cpp\v4.0. I have tried various ways to encapsule the Windows path with spaces but to no avail.

 

The following

 

   file { "\"c:\\program files <x86>\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets\"":

      ensure => present,

      source => 'puppet:///modules/install_programs/Microsoft.CppCommon.targets',

    }

 

causes this error:

 

info: Caching catalog for w7entbase.metratech.com

err: Failed to apply catalog: Parameter path failed: File paths must be fully qualified, not '"c:\program files <x86>\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets"' at /etc/puppetlabs/puppet/modules/test/manifests/init.pp:17

 

Any suggestions will be greatly appreciated.


Werner

David Schmitt

unread,
May 17, 2013, 10:25:41 AM5/17/13
to puppet...@googlegroups.com
Hi,

On 17.05.2013 15:28, wernerbahlke wrote:
> I have to change a file in c:\Program Files
> <x86>\MSBuild\Microsoft.Cpp\v4.0. I have tried various ways to encapsule
> the Windows path with spaces but to no avail.
>
> The following
>
> file { "\"c:\\program files
> <x86>\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets\"":


> err: Failed to apply catalog: Parameter path failed: File paths must be
> fully qualified, not '"c:\program files
> <x86>\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets"' at
> /etc/puppetlabs/puppet/modules/test/manifests/init.pp:17
>
> Any suggestions will be greatly appreciated.

You do not need to put the extra double quotes inside the string.

> "c:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets"


should be completely sufficient. also not that you have posted angle
brackets around "x86", but usually the directory has normal brackets,
like I show here.


For more in-depth discussion of filenames under windows in puppet,
please see the docs at

> http://docs.puppetlabs.com/windows/writing.html#file-paths-on-windows


Regards, David
Reply all
Reply to author
Forward
0 new messages