Skip to content

Commit

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

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

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

// Check if the cidr is changed
Expand Down

0 comments on commit 7a275fb

Please sign in to comment.