packer/plugin: Assume any listen error is a port collision [GH-58]
This commit is contained in:
parent
9dadd1ce8a
commit
62cfa9983d
|
@ -7,6 +7,8 @@ IMPROVEMENTS:
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
|
* core: Plugin servers consider a port in use if there is any
|
||||||
|
error listening to it. This fixes I18n issues and Windows. [GH-58]
|
||||||
* amazon-ebs: Sleep between checking instance state to avoid
|
* amazon-ebs: Sleep between checking instance state to avoid
|
||||||
RequestLimitExceeded [GH-50]
|
RequestLimitExceeded [GH-50]
|
||||||
* vagrant: Rename VirtualBox ovf to "box.ovf" [GH-64]
|
* vagrant: Rename VirtualBox ovf to "box.ovf" [GH-64]
|
||||||
|
|
|
@ -19,7 +19,6 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const MagicCookieKey = "PACKER_PLUGIN_MAGIC_COOKIE"
|
const MagicCookieKey = "PACKER_PLUGIN_MAGIC_COOKIE"
|
||||||
|
@ -59,14 +58,8 @@ func serve(server *rpc.Server) (err error) {
|
||||||
address = fmt.Sprintf("127.0.0.1:%d", port)
|
address = fmt.Sprintf("127.0.0.1:%d", port)
|
||||||
listener, err = net.Listen("tcp", address)
|
listener, err = net.Listen("tcp", address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !strings.Contains(err.Error(), "address already in use") {
|
err = nil
|
||||||
// Not an address already in use error, return.
|
continue
|
||||||
return
|
|
||||||
} else {
|
|
||||||
// Address is in use, just try another
|
|
||||||
err = nil
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue