Merge pull request #1504 from svanharmelen/f-cloudstack-network

Reverting the behavioural change, while still fixing the logic error
This commit is contained in:
Sander van Harmelen 2015-04-13 18:54:12 +02:00
commit 7a275fb737
1 changed files with 8 additions and 6 deletions

View File

@ -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