Return-Path: X-Original-To: apmail-brooklyn-dev-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D86F17FC0 for ; Fri, 12 Jun 2015 06:10:53 +0000 (UTC) Received: (qmail 14231 invoked by uid 500); 12 Jun 2015 06:10:53 -0000 Delivered-To: apmail-brooklyn-dev-archive@brooklyn.apache.org Received: (qmail 14199 invoked by uid 500); 12 Jun 2015 06:10:53 -0000 Mailing-List: contact dev-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list dev@brooklyn.incubator.apache.org Received: (qmail 14188 invoked by uid 99); 12 Jun 2015 06:10:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2015 06:10:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 12 Jun 2015 06:08:42 +0000 Received: (qmail 14075 invoked by uid 99); 12 Jun 2015 06:10:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2015 06:10:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 73E66DFFD5; Fri, 12 Jun 2015 06:10:29 +0000 (UTC) From: nakomis To: dev@brooklyn.incubator.apache.org Reply-To: dev@brooklyn.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-brooklyn pull request: Windows support improvements in J... Content-Type: text/plain Message-Id: <20150612061029.73E66DFFD5@git1-us-west.apache.org> Date: Fri, 12 Jun 2015 06:10:29 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Github user nakomis commented on a diff in the pull request: https://github.com/apache/incubator-brooklyn/pull/685#discussion_r32292331 --- Diff: locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java --- @@ -1026,7 +1057,33 @@ public void apply(TemplateOptions t, ConfigBag props, Object v) { } else if (t instanceof SoftLayerTemplateOptions) { ((SoftLayerTemplateOptions)t).userData(Strings.toString(v)); } else { - LOG.info("ignoring userDataString({}) in VM creation because not supported for cloud/type ({})", v, t.getClass()); + // Try reflection: userData(String), or guestCustomizationScript(String); + // the latter is used by vCloud Director. + Class clazz = t.getClass(); + Method userDataMethod = null; + try { + userDataMethod = clazz.getMethod("userData", String.class); + } catch (SecurityException e) { + LOG.info("Problem reflectively inspecting methods of "+t.getClass()+" for setting userData", e); + } catch (NoSuchMethodException e) { + try { + // For vCloud Director + userDataMethod = clazz.getMethod("guestCustomizationScript", String.class); + } catch (NoSuchMethodException e2) { + // expected on various other clouds + } + } + if (userDataMethod != null) { + try { + userDataMethod.invoke(Strings.toString(v)); --- End diff -- `userDataMethod.invoke(t, Strings.toString(v));` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---