hashicorp / packer-plugin-vagrant

Packer plugin for Vagrant
https://packer.io
Mozilla Public License 2.0
13 stars 24 forks source link

parallels: error when no VM file found in source #107

Closed lbajolet-hashicorp closed 5 months ago

lbajolet-hashicorp commented 5 months ago

The post-processor, when consuming a parallels artifact, checks for the presence of a pvm or macvm file from the files of the artifact received, and copies it in the output box for vagrant to use later. However, if the artifact does not contain a compatible file, the post-processor does not error, and instead returns a success, leading to an unusable box being produced.

To avoid this, we count the files copied, and if none were, the box will be unusable, so the post-processor errors now.

lbajolet-hashicorp commented 5 months ago

@nywilken regarding the failing test, I opted to add some mocked file hierarchy for the parallels test, and added another one to ensure we do fail when no files are present in the artifact. To be sure if you can do a quick second peek at the code that'd be great, and we can merge if that looks good to you