2013-09-02 22:23:52 -05:00
|
|
|
package qemu
|
|
|
|
|
|
|
|
import (
|
2019-07-02 13:56:28 -07:00
|
|
|
"log"
|
|
|
|
|
2018-01-19 16:18:44 -08:00
|
|
|
"github.com/hashicorp/packer/helper/multistep"
|
2013-09-02 22:23:52 -05:00
|
|
|
)
|
|
|
|
|
2019-07-02 13:56:28 -07:00
|
|
|
func commHost(host string) func(multistep.StateBag) (string, error) {
|
|
|
|
return func(state multistep.StateBag) (string, error) {
|
|
|
|
if host != "" {
|
|
|
|
log.Printf("Using ssh_host value: %s", host)
|
|
|
|
return host, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return "127.0.0.1", nil
|
|
|
|
}
|
2015-06-13 19:23:33 -04:00
|
|
|
}
|
|
|
|
|
2019-03-19 14:47:21 +01:00
|
|
|
func commPort(state multistep.StateBag) (int, error) {
|
|
|
|
sshHostPort := state.Get("sshHostPort").(int)
|
|
|
|
return int(sshHostPort), nil
|
2013-09-02 22:23:52 -05:00
|
|
|
}
|