From f8d190f5375d1f5a4efe441b3357e14c694314ce Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Thu, 18 Jun 2015 10:45:15 -0700 Subject: [PATCH] fix compile error not caught by 'make dev' --- builtin/providers/cloudstack/resource_cloudstack_instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/providers/cloudstack/resource_cloudstack_instance.go b/builtin/providers/cloudstack/resource_cloudstack_instance.go index 64384025dc..44a03f867d 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_instance.go +++ b/builtin/providers/cloudstack/resource_cloudstack_instance.go @@ -168,10 +168,10 @@ func resourceCloudStackInstanceCreate(d *schema.ResourceData, meta interface{}) if userData, ok := d.GetOk("user_data"); ok { //deployVirtualMachine uses POST, so max userdata is 32K //https://github.com/xanzy/go-cloudstack/commit/c767de689df1faedfec69233763a7c5334bee1f6 - if len(ud) > 32768 { + if len(userData.(string)) > 32768 { return fmt.Errorf( "The supplied user_data contains %d bytes before encoding, "+ - "this exeeds the limit of 32768 bytes", len(ud)) + "this exeeds the limit of 32768 bytes", len(userData.(string))) } ud := base64.StdEncoding.EncodeToString([]byte(userData.(string))) p.SetUserdata(ud)