Skip to content

Commit

Permalink
Merge pull request #1492 from svanharmelen/f-cloudstack-network
Browse files Browse the repository at this point in the history
Fixing a small logic error
  • Loading branch information
Sander van Harmelen committed Apr 11, 2015
2 parents 3fc6397 + 8c37a95 commit 852e7a3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions builtin/providers/cloudstack/resource_cloudstack_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,14 @@ func resourceCloudStackNetworkUpdate(d *schema.ResourceData, meta interface{}) e
// Create a new parameter struct
p := cs.Network.NewUpdateNetworkParams(d.Id())

// Check if the name or display text is changed
if d.HasChange("name") || d.HasChange("display_text") {
// Check if the name is changed
if d.HasChange("name") {
p.SetName(name)
}

// Compute/set the display text
displaytext := d.Get("display_text").(string)
if displaytext == "" {
displaytext = name
}
// Check if the display text is changed
if d.HasChange("display_text") {
p.SetDisplaytext(d.Get("display_text").(string))
}

// Check if the cidr is changed
Expand Down

0 comments on commit 852e7a3

Please sign in to comment.