Skip to content

Commit

Permalink
Fix creation config
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed Oct 15, 2020
1 parent 9768872 commit 2453fee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
@@ -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>
Expand All @@ -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>
15 changes: 8 additions & 7 deletions src/Corsinvest.ProxmoxVE.Pepper/Program.cs
Expand Up @@ -14,6 +14,7 @@
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;

Expand Down Expand Up @@ -43,16 +44,16 @@ static int Main(string[] args)

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,
Expand Down Expand Up @@ -90,9 +91,9 @@ static int Main(string[] args)
}
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}");
}
}
Expand Down

0 comments on commit 2453fee

Please sign in to comment.