You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Ignasi Barrera <no...@github.com> on 2016/10/27 09:55:41 UTC

[jclouds/jclouds-karaf] JCLOUDS-1191: Avoid NPE and let commands properly print the stacktraces (#85)

https://issues.apache.org/jira/browse/JCLOUDS-1191
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-karaf/pull/85

-- Commit Summary --

  * JCLOUDS-1191: Avoid NPE and let commands properly print the stacktraces

-- File Changes --

    M commands/src/main/java/org/jclouds/karaf/commands/compute/ComputeCommandWithOptions.java (2)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/HardwareListCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/ImageCreateCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/ImageListCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/LocationListCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeCreateCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeDestroyAllCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeDestroyCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeInfoCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeListCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeResumeCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/NodeSuspendCommand.java (1)
    M commands/src/main/java/org/jclouds/karaf/commands/compute/RunScriptBase.java (1)

-- Patch Links --

https://github.com/jclouds/jclouds-karaf/pull/85.patch
https://github.com/jclouds/jclouds-karaf/pull/85.diff

-- 
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/85

Re: [jclouds/jclouds-karaf] JCLOUDS-1191: Avoid NPE and let commands properly print the stacktraces (#85)

Posted by Andrew Gaul <no...@github.com>.
andrewgaul commented on this pull request.



> @@ -87,7 +87,7 @@ protected ComputeService getComputeService() throws IOException {
       String apiValue = EnvHelper.getComputeApi(api);
       String identityValue = EnvHelper.getComputeIdentity(identity);
       String credentialValue = EnvHelper.getComputeCredential(credential);
-      if (providerValue.equals("google-compute-engine")) {
+      if (providerValue != null && credentialValue != null && providerValue.equals("google-compute-engine")) {

Should this check `credentialValue`?

-- 
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/85#pullrequestreview-6304327

Re: [jclouds/jclouds-karaf] JCLOUDS-1191: Avoid NPE and let commands properly print the stacktraces (#85)

Posted by Ignasi Barrera <no...@github.com>.
nacx commented on this pull request.



> @@ -87,7 +87,7 @@ protected ComputeService getComputeService() throws IOException {
       String apiValue = EnvHelper.getComputeApi(api);
       String identityValue = EnvHelper.getComputeIdentity(identity);
       String credentialValue = EnvHelper.getComputeCredential(credential);
-      if (providerValue.equals("google-compute-engine")) {
+      if (providerValue != null && credentialValue != null && providerValue.equals("google-compute-engine")) {

Yes, to avoid an NPE when trying to parse the json file. The helper method expects the value not to be null.

-- 
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/85