2016-01-11 12:22:41 +01:00
|
|
|
package cloudstack
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2018-01-19 16:18:44 -08:00
|
|
|
"github.com/hashicorp/packer/helper/multistep"
|
2016-01-11 12:22:41 +01:00
|
|
|
)
|
|
|
|
|
2017-07-17 09:05:12 +02:00
|
|
|
func commPort(state multistep.StateBag) (int, error) {
|
|
|
|
commPort, hasPort := state.Get("commPort").(int)
|
|
|
|
if !hasPort {
|
|
|
|
return 0, fmt.Errorf("Failed to retrieve communication port")
|
2016-01-11 12:22:41 +01:00
|
|
|
}
|
|
|
|
|
2017-07-17 09:05:12 +02:00
|
|
|
return commPort, nil
|
2016-01-11 12:22:41 +01:00
|
|
|
}
|