Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

using file extension in resource name duplicates file extension. #53

Open
mmarseglia opened this issue May 29, 2015 · 1 comment
Open

Comments

@mmarseglia
Copy link

Ran into an issue with the following code

 45       $packer_basename = inline_template(
 46         "<%= \"#{@prefix}#{@version}_#{scope['::kernel'].downcase}_#{@arch}.zip\" %>"
 47       )
 48
 49       $packer_url = "${packer::params::base_url}${packer_basename}"
 50
 51       # Download the Packer zip archive to the cache.
 52       archive { $packer_basename :
 53         ensure           => present,
 54         url              => "${packer_url}",
 55         target           => $bin_dir,
 56         follow_redirects => true,
 57         extension        => 'zip',
 58         checksum         => false,
 59         src_target       => $cache_dir,
 60       }

it produced this output, where it appended .zip to the file name.

Notice: /Stage[main]/Packer/Archive[packer_0.7.5_linux_amd64.zip]/Archive::Download[packer_0.7.5_linux_amd64.zip.zip]/Exec[download archive packer_0.7.5_linux_amd64.zip.zip and check sum]/returns: executed successfully
Notice: /Stage[main]/Packer/Archive[packer_0.7.5_linux_amd64.zip]/Archive::Extract[packer_0.7.5_linux_amd64.zip]/Exec[packer_0.7.5_linux_amd64.zip unpack]/returns: executed successfully
Notice: /Stage[main]/Main/Node[xagent.vagrant.vm]/Packer::Plugin[post-processor-vagrant-vmware-ovf]/Archive[packer-post-processor-vagrant-vmware-ovf.linux-amd64]/Archive::Extract[packer-post-processor-vagrant-vmware-ovf.linux-amd64]/Exec[packer-post-processor-vagrant-vmware-ovf.linux-amd64 unpack]/returns: executed successfully

vagrant]# ls /tmp/
packer_0.7.5_linux_amd64.zip.zip

It didn't error but the output was unexpected. Am I missing something?

@aj-jester
Copy link

@mmarseglia Thats because $packer_basename == packer_0.7.5_linux_amd64.zip and then added extension == zip (because of this line). So looking at your code above, simple remove .zip from line 46 and you should see the proper file name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants