Update SSH client to patched version
This commit is contained in:
+3
-3
@@ -62,9 +62,9 @@
|
||||
<HintPath>..\packages\MlkPwgen.0.2.0.0\lib\net45\MlkPwgen.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Renci.SshNet, Version=2013.4.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SSH.NET.2013.4.7\lib\net40\Renci.SshNet.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\References\Renci.SshNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -7,5 +7,4 @@
|
||||
<package id="log4net" version="2.0.8" targetFramework="net45" />
|
||||
<package id="MathNet.Numerics" version="4.5.1" targetFramework="net45" />
|
||||
<package id="MlkPwgen" version="0.2.0.0" targetFramework="net45" />
|
||||
<package id="SSH.NET" version="2013.4.7" targetFramework="net45" />
|
||||
</packages>
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user