mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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>
This commit is contained in:
parent
3e613788e9
commit
770860aee4
@ -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);
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user