From 8c37a95a5e97c82eb614bd500d716d14d088e9d0 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Sat, 11 Apr 2015 17:53:25 +0200 Subject: [PATCH] Fixing a small logic error --- .../cloudstack/resource_cloudstack_network.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/builtin/providers/cloudstack/resource_cloudstack_network.go b/builtin/providers/cloudstack/resource_cloudstack_network.go index 51dc7d9e0..20caea727 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_network.go +++ b/builtin/providers/cloudstack/resource_cloudstack_network.go @@ -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