You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/02/11 20:48:59 UTC

[22/29] git commit: refs/heads/ui-plugins - CLOUDSTACK-710: mkdir -p destination before scp-ing file in CitrixResourceBase

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 <bh...@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/770860ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/770860ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/770860ae

Branch: refs/heads/ui-plugins
Commit: 770860aee473fd65def96b6eeef5c54544514d6f
Parents: 3e61378
Author: Rohit Yadav <bh...@apache.org>
Authored: Mon Feb 11 16:38:18 2013 +0530
Committer: Rohit Yadav <bh...@apache.org>
Committed: Mon Feb 11 16:39:16 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/770860ae/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);
 
                     }