Update SSH client to patched version

This commit is contained in:
2019-11-19 14:52:12 -05:00
parent 51301528df
commit 8763a86840
5 changed files with 19629 additions and 12 deletions
+15 -8
View File
@@ -47,9 +47,9 @@ namespace LeafWeb.Core.Remote
private void Connect(PiscalLeafInput leafInput, BaseClient scp)
{
try
{
scp.Connect();
}
{
scp.Connect();
}
catch (Exception ex)
{
var message = $"Exception while connecting to client. Message: {ex.Message}";
@@ -72,13 +72,20 @@ namespace LeafWeb.Core.Remote
}
}
private void CopyLeafInput(PiscalLeafInput leafInput, string directory)
private void CopyLeafInput(PiscalLeafInput leafInput)
{
// copy files
// create directory
using (var sshClient = GetSshClient())
{
sshClient.Connect();
var runCommand = sshClient.RunCommand($"mkdir {BaseDirectory}/{leafInput.PiscalDirectoryName}");
sshClient.RunCommand($"mkdir {BaseDirectory}/{leafInput.PiscalDirectoryName}/input");
}
// copy files
using (var scp = GetScpClient())
foreach (var file in leafInput.InputFiles)
{
var inputPath = $"{directory}/input/{file.Filename}";
var inputPath = $"{BaseDirectory}/{leafInput.PiscalDirectoryName}/input/{file.Filename}";
using (var stream = new MemoryStream(file.Contents))
{
_logger.Debug("Copying " + inputPath);
@@ -96,9 +103,9 @@ namespace LeafWeb.Core.Remote
if (string.IsNullOrEmpty(leafInput.PhotosyntheticType))
throw new PiscalClientException(leafInput.LeafInputId, "No PhotosyntheticType set");
var inputDirectory = $"{BaseDirectory}/{leafInput.PiscalDirectoryName}";
//var inputDirectory = $"{BaseDirectory}/{leafInput.PiscalDirectoryName}";
CopyLeafInput(leafInput, inputDirectory);
CopyLeafInput(leafInput);
// begin processing
using (var ssh = GetSshClient())