Skip to content

Commit 5eb767f

Browse files
committed
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>
1 parent e3156a6 commit 5eb767f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4713,6 +4713,7 @@ protected boolean setupServer(Connection conn) {
47134713
throw new CloudRuntimeException("Unable to authenticate");
47144714
}
47154715

4716+
com.trilead.ssh2.Session session = sshConnection.openSession();
47164717
SCPClient scp = new SCPClient(sshConnection);
47174718

47184719
List<File> files = getPatchFiles();
@@ -4761,6 +4762,12 @@ protected boolean setupServer(Connection conn) {
47614762
if (s_logger.isDebugEnabled()) {
47624763
s_logger.debug("Copying " + f + " to " + d + " on " + hr.address + " with permission " + p);
47634764
}
4765+
try {
4766+
session.execCommand("mkdir -p " + d);
4767+
} catch (IOException e) {
4768+
s_logger.debug("Unable to create destination path: " + d + " on " + hr.address + " but trying anyway");
4769+
4770+
}
47644771
scp.put(f, d, p);
47654772

47664773
}

0 commit comments

Comments
 (0)