1
0
Fork 0
mirror of https://github.com/Corsinvest/cv4pve-pepper.git synced 2025-02-12 10:01:53 +00:00

Fix creation config

This commit is contained in:
Daniele Corsini 2020-10-15 15:12:33 +02:00
parent 97688723a2
commit 2453fee884
2 changed files with 10 additions and 9 deletions

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.3.6</Version>
<Version>1.3.7</Version>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>cv4pve-pepper</AssemblyName>
<Company>Corsinvest Srl</Company>
@ -19,6 +19,6 @@
<TrimmerRootAssembly Include="System.Net.WebClient" />
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="2.6.9" />
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="2.6.10" />
</ItemGroup>
</Project>

View file

@ -14,6 +14,7 @@ using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using Corsinvest.ProxmoxVE.Api.Extension.Helpers;
using Corsinvest.ProxmoxVE.Api.Extension.VM;
using Corsinvest.ProxmoxVE.Api.Shell.Helpers;
using McMaster.Extensions.CommandLineUtils;
@ -43,16 +44,16 @@ namespace Corsinvest.ProxmoxVE.Pepper
app.OnExecute(() =>
{
var fileName = Path.GetTempFileName().Replace(".tmp", ".vv");
var client = app.ClientTryLogin();
var content = client.GetVM(optVmId.Value())
.GetSpiceFileVV(optProxy.HasValue() ? optProxy.Value() : null);
var ret = SpiceHelper.CreateFileSpaceClient(client,
optVmId.Value(),
optProxy.HasValue() ? optProxy.Value() : null,
fileName);
var ret = client.LastResult.IsSuccessStatusCode;
if (ret)
{
var fileName = Path.GetTempFileName().Replace(".tmp", ".vv");
File.WriteAllText(fileName, content);
var startInfo = new ProcessStartInfo
{
UseShellExecute = false,
@ -90,9 +91,9 @@ namespace Corsinvest.ProxmoxVE.Pepper
}
else
{
if (!client.LastResult.IsSuccessStatusCode)
if (!app.ClientTryLogin().LastResult.IsSuccessStatusCode)
{
app.Out.WriteLine($"Error: {client.LastResult.ReasonPhrase}");
app.Out.WriteLine($"Error: {app.ClientTryLogin().LastResult.ReasonPhrase}");
}
}