use port as ints

This commit is contained in:
Adrien Delorme
2019-03-19 14:47:21 +01:00
parent f828b72c10
commit 5a6dffde9a
47 changed files with 112 additions and 113 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ import (
// userDataTemplateData represents variables for user_data interpolation
type userDataTemplateData struct {
HTTPIP string
HTTPPort uint
HTTPPort int
}
// stepCreateInstance represents a Packer build step that creates CloudStack instances.
@@ -86,7 +86,7 @@ func (s *stepCreateInstance) Run(_ context.Context, state multistep.StateBag) mu
}
if config.UserData != "" {
httpPort := state.Get("http_port").(uint)
httpPort := state.Get("http_port").(int)
httpIP, err := hostIP()
if err != nil {
err := fmt.Errorf("Failed to determine host IP: %s", err)