Reverting the behavioural change, while still fixing the logic error

This commit is contained in:
Sander van Harmelen 2015-04-13 17:33:22 +02:00
parent eeb46e4642
commit 41536c0d58
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