arista-eosplus / packer-veos

Packer.io automation of the vEOS nodes
30 stars 12 forks source link

Packer build cannot find binary if path contains spaces on Windows #10

Open jeffbrl opened 5 years ago

jeffbrl commented 5 years ago

If this script installs packer in a Windows directory that contains spaces, the packer build command will fail as it cannot locate the packer binary.

Executing command:C:\Users\Jeff Loughridge\packer-bin\packer build --parallel=false -var boot_time=2m30s -var name='20190209_082254' vEOS-windows.json
'C:\Users\Jeff' is not recognized as an internal or external command,
operable program or batch file.
Return code:1
Packer install failed!!!

I fixed this by putting double quotes around the path to the binary.

   try:
        if (hyper == "virtualbox" and hostOS=="windows"):
            cmd = '"%s" build --parallel=false %s vEOS-windows.json' % (packerCmd, OPTS)
            print "Executing command:%s" % cmd

Please let me know if you want me to submit a PR.