Skip to content

Commit

Permalink
Merge pull request #102 from wenlock/fix_deployment
Browse files Browse the repository at this point in the history
remove hard coded deployment network call
  • Loading branch information
sfc-gh-eraigosa authored Jan 29, 2017
2 parents 7b9c119 + 805a5dd commit d0f1e96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions ov/connectionv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import (
"strings"
)

func (c *OVClient) ManageI3SConnections(connections []Connection) ([]Connection, error) {
// ManageI3SConnections - setup connections for i3s deployment network
func (c *OVClient) ManageI3SConnections(connections []Connection, netname string) ([]Connection, error) {

//Find the deploy net called deploy.net
deployNet, err := c.GetEthernetNetworkByName("deploy.net")
deployNet, err := c.GetEthernetNetworkByName(netname)
if err != nil || deployNet.URI.IsNil() {
return connections, fmt.Errorf("Could not find deployment ethernet network name: deploy.net")
return connections, fmt.Errorf("Could not find deployment ethernet network name: %s", netname)
}

//This section finds which PortIds we have available so we can apply new port ids to connections that have the boot PortIds(Which the boot connections need).
Expand Down
5 changes: 3 additions & 2 deletions ov/profilesv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package ov

import (
"fmt"

"github.com/HewlettPackard/oneview-golang/utils"
"github.com/docker/machine/libmachine/log"
)
Expand Down Expand Up @@ -106,7 +107,7 @@ type CustomizeServer struct {
ProfileName string // name of server
OSDeploymentBuildPlan string // name of the OS build plan
OSDeploymentAttributes map[string]string // name value pairs for server custom attributes

EthernetNetworkName string // deployment network name
}

// CustomizeServer - Customize Server
Expand Down Expand Up @@ -139,7 +140,7 @@ func (c *OVClient) CustomizeServer(cs CustomizeServer) error {
s.OSDeploymentSettings.OSDeploymentPlanUri = osDeploymentPlan.URI
s.OSDeploymentSettings.OSCustomAttributes = serverDeploymentAttributes

s.Connections, err = c.ManageI3SConnections(s.Connections)
s.Connections, err = c.ManageI3SConnections(s.Connections, cs.EthernetNetworkName)
if err != nil {
return err
}
Expand Down

0 comments on commit d0f1e96

Please sign in to comment.