diff --git a/go.mod b/go.mod index 31050fd1..efe204b4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/terraform-provider-oneview go 1.15 require ( - github.com/HewlettPackard/oneview-golang v8.8.0+incompatible + github.com/HewlettPackard/oneview-golang v8.9.0+incompatible github.com/docker/machine v0.16.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-getter v1.6.2 // indirect diff --git a/go.sum b/go.sum index 5a70cce5..7972fe24 100644 --- a/go.sum +++ b/go.sum @@ -34,14 +34,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/HewlettPackard/oneview-golang v8.6.0+incompatible h1:5/s9xGTGiVyISxWaxT/QlVYx/bIQvCyQo4UA9VgX0Ek= -github.com/HewlettPackard/oneview-golang v8.6.0+incompatible/go.mod h1:GJcjWgNHrKtt2lUl4xcaV3NRiuBlG138DNrFygXj4JE= -github.com/HewlettPackard/oneview-golang v8.6.1-0.20231109094213-30a3fb89caf6+incompatible h1:wldabw1+dMd4Pa2ByJ3iV18uFC8pFMxPZO5Q4D3dnq0= -github.com/HewlettPackard/oneview-golang v8.6.1-0.20231109094213-30a3fb89caf6+incompatible/go.mod h1:GJcjWgNHrKtt2lUl4xcaV3NRiuBlG138DNrFygXj4JE= -github.com/HewlettPackard/oneview-golang v8.7.0+incompatible h1:qOVzKT1euEpjZDVPLUfaOS0GlrO4IlKMEF2uEeFMSbQ= -github.com/HewlettPackard/oneview-golang v8.7.0+incompatible/go.mod h1:GJcjWgNHrKtt2lUl4xcaV3NRiuBlG138DNrFygXj4JE= -github.com/HewlettPackard/oneview-golang v8.8.0+incompatible h1:GNRm4HtGMdDHB3dzYRz5JnjJODC0llpIlXX419qhhcE= -github.com/HewlettPackard/oneview-golang v8.8.0+incompatible/go.mod h1:GJcjWgNHrKtt2lUl4xcaV3NRiuBlG138DNrFygXj4JE= +github.com/HewlettPackard/oneview-golang v8.9.0+incompatible h1:sCTkRoXIpmkTLjC2dRQiRjYlNLZGIBVYnQqyG5u1buA= +github.com/HewlettPackard/oneview-golang v8.9.0+incompatible/go.mod h1:GJcjWgNHrKtt2lUl4xcaV3NRiuBlG138DNrFygXj4JE= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= diff --git a/vendor/github.com/HewlettPackard/oneview-golang/ov/profiles.go b/vendor/github.com/HewlettPackard/oneview-golang/ov/profiles.go index 1db270b9..8f450fc8 100644 --- a/vendor/github.com/HewlettPackard/oneview-golang/ov/profiles.go +++ b/vendor/github.com/HewlettPackard/oneview-golang/ov/profiles.go @@ -21,7 +21,6 @@ import ( "encoding/json" "errors" "fmt" - "os" "reflect" "strings" @@ -447,19 +446,9 @@ func (c *OVClient) SubmitNewProfile(p ServerProfile, ignoreFlags ...ForceFlag) ( log.Debugf("REST : %s \n %+v\n", uri, p) log.Debugf("task -> %+v", t) - // Get available server hardwares to assign it to SP - if p.ServerHardwareURI != "" { - - isHardwareAvailable, err := c.GetAvailableServers(p.ServerHardwareURI.String()) - if err != nil || isHardwareAvailable == false { - log.Errorf("Error getting available Hardware: %s", p.ServerHardwareURI.String()) - if err != nil { - log.Warnf("Error: %s", err) - } - os.Exit(1) - } - - server, err = c.GetServerHardwareByUri(p.ServerHardwareURI) + // Check if server hardware already has server profile assigned + if server.ServerProfileURI.String() != "null" { + return fmt.Errorf("hardware %s already has server profile assigned", server.Name) } server, err = c.GetServerHardwareByUri(p.ServerHardwareURI) diff --git a/vendor/modules.txt b/vendor/modules.txt index d154fe8d..c2656382 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,7 +8,7 @@ cloud.google.com/go/internal/trace cloud.google.com/go/internal/version # cloud.google.com/go/storage v1.10.0 cloud.google.com/go/storage -# github.com/HewlettPackard/oneview-golang v8.8.0+incompatible +# github.com/HewlettPackard/oneview-golang v8.9.0+incompatible ## explicit github.com/HewlettPackard/oneview-golang/liboneview github.com/HewlettPackard/oneview-golang/ov