cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/hotfix/scp-exception to 61c2333
Date Thu, 11 Dec 2014 15:57:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/hotfix/scp-exception [created] 61c233395


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/61c23339
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/61c23339
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/61c23339

Branch: refs/heads/hotfix/scp-exception
Commit: 61c233395558ec6a2ec2ebeb64db743908083558
Parents: fdb782f
Author: Daan Hoogland <dhoogland@schubergphilis.com>
Authored: Thu Dec 11 16:55:26 2014 +0100
Committer: Daan Hoogland <daan@onecht.net>
Committed: Thu Dec 11 16:55:26 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61c23339/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 f01153f..6eb787d 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
@@ -4728,14 +4728,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()) {
@@ -4743,16 +4743,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