magfest / reggie-formula

SaltStack formula and dev environment for Reggie, MAGFest's registration and management system
GNU General Public License v3.0
1 stars 6 forks source link

windows: build broken due to using colons in box name, not allowed on windows filenames #8

Closed msg4real closed 5 years ago

msg4real commented 5 years ago

There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "02943c4d-2f23-4507-b808-ddbecde305f2", "--name", "reggie(super 2019) 2018-11-26 16:21:23.061"]

Stderr: VBoxManage.exe: error: Could not rename the directory 'C:\Users\user\VirtualBox VMs\ubuntu-18.04-amd64_1543267285219_53335' to 'C:\Users\user\VirtualBox VMs\reggie (super 2019) 2018-11-26 16:21:23.061' to save the settings file (VERR_INVALID_NAME) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown VBoxManage.exe: error: Context: "SaveSettings()" at line 3123 of file VBoxManageModifyVM.cpp

Suspect line in vagrantfile

vb.name = 'reggie (%s %s) %s' % [ENV['EVENT_NAME'], ENV['EVENT_YEAR'], Time.now.strftime('%Y-%m-%d %H:%M:%S.%L')]

msg4real commented 5 years ago

Change the code to

if Vagrant::Util::Platform.windows?
#Make vm called reggie (event year) epoch.time
vb.name = 'reggie (%s %s) %s' % [ENV['EVENT_NAME'], ENV['EVENT_YEAR'], Time.now.strftime('%s')]

else
#Have the the vm called reggie (event year) and human readable time 
vb.name = 'reggie (%s %s) %s' % [ENV['EVENT_NAME'], ENV['EVENT_YEAR'], Time.now.strftime('%Y-%m-%d %H:%M:%S.%L')]
end
binary1230 commented 5 years ago

fixed in #12