Re: [jclouds/jclouds-karaf] JCLOUDS-1172: Explicitly fallback to the Groovy scripting engine (#78)

2016-09-11 Thread Andrew Phillips
@nacx Good to close this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/78#issuecomment-246185494

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Andrew Phillips
>private final ScriptEngine scriptEngine;
>  
>/**
> * Constructor
> * @param engine
> */
> -  public ScriptEngineShellTable(String engine) {
> -this.engine = engine;
> -this.scriptEngine = scriptEngineFactory.getEngineByName(engine);
> +  public ScriptEngineShellTable(ScriptEngineManager scriptEngineManager, 
> String engine) {
> +this.scriptEngine = scriptEngineManager.getEngineByName(engine);
> +if (scriptEngine == null) {
> +   throw new IllegalStateException("Unable to load script engine " + 
> engine);
> +}

@nacx Something like this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79/files/5e0fcbef105bdb8bed0461519fb7b0d2671beed3#r78297007

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Andrew Phillips
> @@ -51,8 +52,9 @@ public String evaluate(Object obj, String expression) {
>  try {
>scriptEngine.put(getType(), obj);
>result = String.valueOf(scriptEngine.eval(expression));
> -} catch (Exception ex) {
> -  //Ignore
> +} catch (Exception exception) {
> +   result = format("Unable to evaluate expression %s due to: %s. Please 
> check your shell confugration",

@nacx Suggestions for different messages welcome ;-)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79/files/5e0fcbef105bdb8bed0461519fb7b0d2671beed3#r78297013

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Andrew Phillips
@nacx Reformatted and added the ISE if the requested engine can't be loaded. 
Please take a look to see there's anything that still needs to be changed!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79#issuecomment-246185884

Re: [jclouds/jclouds-karaf] JCLOUDS-1172: Explicitly fallback to the Groovy scripting engine (#78)

2016-09-11 Thread Ignasi Barrera
Closed #78.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/78#event-785275406

Re: [jclouds/jclouds-karaf] JCLOUDS-1172: Explicitly fallback to the Groovy scripting engine (#78)

2016-09-11 Thread Ignasi Barrera
Absolutely! :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/78#issuecomment-246199320

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Ignasi Barrera
>private final ScriptEngine scriptEngine;
>  
>/**
> * Constructor
> * @param engine
> */
> -  public ScriptEngineShellTable(String engine) {
> -this.engine = engine;
> -this.scriptEngine = scriptEngineFactory.getEngineByName(engine);
> +  public ScriptEngineShellTable(ScriptEngineManager scriptEngineManager, 
> String engine) {
> +this.scriptEngine = scriptEngineManager.getEngineByName(engine);
> +if (scriptEngine == null) {
> +   throw new IllegalStateException("Unable to load script engine " + 
> engine);
> +}

Lgtm!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79/files/5e0fcbef105bdb8bed0461519fb7b0d2671beed3#r78301017

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Ignasi Barrera
> @@ -51,8 +52,9 @@ public String evaluate(Object obj, String expression) {
>  try {
>scriptEngine.put(getType(), obj);
>result = String.valueOf(scriptEngine.eval(expression));
> -} catch (Exception ex) {
> -  //Ignore
> +} catch (Exception exception) {
> +   result = format("Unable to evaluate expression %s due to: %s. Please 
> check your shell confugration",

H that text will go in a column and it will probably be trimmed or 
difficult to read. WDYT about changing it to "## VALUE ERROR ##" or whatever 
short error marker we like, and move the detailed message to the log, with the 
complete stacktrace?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79/files/5e0fcbef105bdb8bed0461519fb7b0d2671beed3#r78301091

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Ignasi Barrera
Just two final comments, but LGTM!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79#issuecomment-246199894

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Ignasi Barrera
Do you think it makes sense to move the copied classes to their own package so 
they are easy to reference (if that is needed or helps at some point)?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79#issuecomment-246199857

[jira] [Commented] (JCLOUDS-1175) Remove hardcoded limitation of content size in Openstack Nova CreateServerOptions API

2016-09-11 Thread Ignasi Barrera (JIRA)

[ 
https://issues.apache.org/jira/browse/JCLOUDS-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15482288#comment-15482288
 ] 

Ignasi Barrera commented on JCLOUDS-1175:
-

Thanks for reporting! Do you want to try opening a pull request with the patch? 
I would be happy to help!

> Remove hardcoded limitation of content size in Openstack Nova 
> CreateServerOptions API
> -
>
> Key: JCLOUDS-1175
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1175
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 1.9.2, 2.0.0, 2.1.0
> Environment: Openstack Nova Liberty+
>Reporter: Arvind Nadendla
>  Labels: easyfix
>
> Openstack allow you to increase the bootstrap file size beyond 10K and the 
> also increase the number of files injected via the configuration drive.
> The Jcloud nova CreateServerOptions API is hardcoded to only allow default 
> size of 10K and 5 files when openstack allows you to change these values via 
> the project quotas.
> Remove following validations from the CreateServerOptions  should fix the 
> issue
>   checkState(personality.size() < 5, "maximum number of files allowed is 
> 5");
> checkArgument(contents.length < 10 * 1024,
>String.format("maximum size of the file is 10KB.  Contents 
> specified is %d bytes", contents.length));



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Andrew Phillips
@nacx Updated with some additional changes

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79#issuecomment-246219889

Re: [jclouds/jclouds-karaf] Try to use an OSGi-compliant way of loading JSR 223 script engines (#79)

2016-09-11 Thread Ignasi Barrera
+1! Many thanks @demobox!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/79#issuecomment-246259756