cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [2/2] git commit: refs/heads/4.1 - CLOUDSTACK-710: mkdir -p destination before scp-ing file in CitrixResourceBase
Date Mon, 11 Feb 2013 11:13:22 GMT
Updated Branches:
  refs/heads/4.1 a880f47fc -> 5eb767f56


CLOUDSTACK-710: mkdir -p destination before scp-ing file in CitrixResourceBase

- Assumption is that mkdir is available on xen host
- We don't know what kind of file we're copying, dirs would have 0777 permission
  by default

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


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

Branch: refs/heads/4.1
Commit: 5eb767f5637084c25fcfcb8290a97a8cec90d33d
Parents: e3156a6
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Mon Feb 11 16:38:18 2013 +0530
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Mon Feb 11 16:42:49 2013 +0530

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java           |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5eb767f5/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 71f2002..c7ff5c7 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -4713,6 +4713,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                     throw new CloudRuntimeException("Unable to authenticate");
                 }
 
+                com.trilead.ssh2.Session session = sshConnection.openSession();
                 SCPClient scp = new SCPClient(sshConnection);
 
                 List<File> files = getPatchFiles();
@@ -4761,6 +4762,12 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                         if (s_logger.isDebugEnabled()) {
                             s_logger.debug("Copying " + f + " to " + d + " on " + hr.address
+ " with permission " + p);
                         }
+                        try {
+                            session.execCommand("mkdir -p " + d);
+                        } catch (IOException e) {
+                            s_logger.debug("Unable to create destination path: " + d + "
on " + hr.address + " but trying anyway");
+
+                        }
                         scp.put(f, d, p);
 
                     }


Mime
View raw message