vagrant package silently fails when --output path contains a slash

Created on 20 Oct 2017  ยท  4Comments  ยท  Source: hashicorp/vagrant

Vagrant version

$ vagrant -v
Vagrant 2.0.0

Host operating system

macOS Sierra

Guest operating system

erickoegel/dfly48

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "erickoegel/dfly48"
  config.vm.provision "shell", path: "bootstrap.sh"
end

bootstrap.sh

#!/bin/sh
sudo pkg update && \
    sudo pkg install -y rsync

Expected behavior

Ideally, Vagrant checks to see if a mcandre directory exists. If not, Vagrant creates the directory and writes a dragonfly-rsync.box file inside the directory.

Or, Vagrant exits with a non-zero status and warns the user that the path would be invalid.

Actual behavior

Vagrant takes several minutes to produce a box, then I have no idea where the box ends up, because no *.box files are produced.

Steps to reproduce

  1. vagrant up
  2. vagrant package --output mcandre/dragonfly-rsync.box

As a workaround, I am careful to --output to dragonfly-rsync.box, and then import the box as mcandre/dragonfly-rsync to my vagrant box list.

bug core

Most helpful comment

I will have time on weekend to polish code and add tests

All 4 comments

@mcandre @briancain
Hello!
I wrote fix in PR. I found that package.output was treated like a string name and not a path. The folder wasn't created. It is my first pull request here. Every suggestion for refactoring and other changes are welcome.
I've marked PR WIP as I did it quickly and It needs test suite.

Thank you for this great library!

I will have time on weekend to polish code and add tests

I did refactor and added test for this functionality. More info on PR.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

barkingfoodog picture barkingfoodog  ยท  3Comments

StefanScherer picture StefanScherer  ยท  3Comments

mpontillo picture mpontillo  ยท  3Comments

jazzfog picture jazzfog  ยท  3Comments

bbaassssiiee picture bbaassssiiee  ยท  3Comments