From 41536c0d582d7acd002db08975e72942969670c0 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Mon, 13 Apr 2015 17:33:22 +0200 Subject: [PATCH] Reverting the behavioural change, while still fixing the logic error --- .../cloudstack/resource_cloudstack_network.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/providers/cloudstack/resource_cloudstack_network.go b/builtin/providers/cloudstack/resource_cloudstack_network.go index 20caea727..4eb03f666 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_network.go +++ b/builtin/providers/cloudstack/resource_cloudstack_network.go @@ -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