cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 90df7cf
Date Fri, 19 Sep 2014 09:56:06 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 6687727b7 -> 90df7cf88


CID-1116298 path can be null, make sure that is properly handled


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6f54d487
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6f54d487
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6f54d487

Branch: refs/heads/master
Commit: 6f54d48772fc6e3a7b756c330b9569a5a2215b74
Parents: 6687727
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Fri Sep 19 11:54:21 2014 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Fri Sep 19 11:54:21 2014 +0200

----------------------------------------------------------------------
 utils/src/com/cloud/utils/script/Script.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f54d487/utils/src/com/cloud/utils/script/Script.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/script/Script.java b/utils/src/com/cloud/utils/script/Script.java
index d2656a8..9713b14 100755
--- a/utils/src/com/cloud/utils/script/Script.java
+++ b/utils/src/com/cloud/utils/script/Script.java
@@ -308,7 +308,7 @@ public class Script implements Callable<String> {
         public Task(OutputInterpreter interpreter, BufferedReader reader) {
             this.interpreter = interpreter;
             this.reader = reader;
-            this.result = null;
+            result = null;
         }
 
         @Override
@@ -340,8 +340,6 @@ public class Script implements Callable<String> {
     public static String findScript(String path, String script) {
         s_logger.debug("Looking for " + script + " in the classpath");
 
-        path = path.replace("/", File.separator);
-
         URL url = ClassLoader.getSystemResource(script);
         s_logger.debug("System resource: " + url);
         File file = null;
@@ -351,6 +349,12 @@ public class Script implements Callable<String> {
             return file.getAbsolutePath();
         }
 
+        if (path == null) {
+            s_logger.warn("No search path specified, unable to look for " + script);
+            return null;
+        }
+        path = path.replace("/", File.separator);
+
         /**
          * Look in WEB-INF/classes of the webapp
          * URI workaround the URL encoding of url.getFile


Mime
View raw message