cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [50/50] [abbrv] git commit: updated refs/heads/hotfix/scp-exception to e13d45e
Date Sat, 21 Feb 2015 11:34:26 GMT
catch specific exception and log clear message on error


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

Branch: refs/heads/hotfix/scp-exception
Commit: e13d45e2c60bbbf6795479c389b23da55c291d08
Parents: 0e31366
Author: Daan Hoogland <dhoogland@schubergphilis.com>
Authored: Thu Dec 11 16:55:26 2014 +0100
Committer: Daan Hoogland <daan@onecht.net>
Committed: Sat Feb 21 12:32:29 2015 +0100

----------------------------------------------------------------------
 .../xenserver/resource/CitrixResourceBase.java  | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e13d45e2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 0d2d473..6d777e4 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -4745,14 +4745,14 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                         } else {
                             f = path + k;
                         }
-                        String d = tokens[tokens.length - 1];
+                        String directoryPath = tokens[tokens.length - 1];
                         f = f.replace('/', File.separatorChar);
 
-                        String p = "0755";
+                        String permissions = "0755";
                         if (tokens.length == 3) {
-                            p = tokens[1];
+                            permissions = tokens[1];
                         } else if (tokens.length == 2) {
-                            p = tokens[0];
+                            permissions = tokens[0];
                         }
 
                         if (!new File(f).exists()) {
@@ -4760,16 +4760,20 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                             continue;
                         }
                         if (s_logger.isDebugEnabled()) {
-                            s_logger.debug("Copying " + f + " to " + d + " on " + hr.address
+ " with permission " + p);
+                            s_logger.debug("Copying " + f + " to " + directoryPath + " on
" + hr.address + " with permission " + permissions);
                         }
                         try {
-                            session.execCommand("mkdir -m 700 -p " + d);
+                            session.execCommand("mkdir -m 700 -p " + directoryPath);
                         } catch (IOException e) {
-                            s_logger.debug("Unable to create destination path: " + d + "
on " + hr.address + " but trying anyway");
-
+                            s_logger.debug("Unable to create destination path: " + directoryPath
+ " on " + hr.address + " but trying anyway");
+                        }
+                        try {
+                            scp.put(f, directoryPath, permissions);
+                        } catch (IOException e) {
+                            String msg = "Unable to copy file " + f + " to path " + directoryPath
+ " with permissions  " + permissions;
+                            s_logger.debug(msg);
+                            throw new CloudRuntimeException("Unable to setup the server:
" + msg, e);
                         }
-                        scp.put(f, d, p);
-
                     }
                 }
 


Mime
View raw message