Skip to content

Commit

Permalink
Fix #32
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed Jun 7, 2024
1 parent 8b39de8 commit 16c5d32
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"preLaunchTask": "build",
// Se i framework di destinazione sono stati modificati, assicurarsi di aggiornare il percorso del programma.
"program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper/bin/Debug/net8.0/cv4pve-pepper.dll",
"args": [],
"args": [
"@Parm.parm"
],
"cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper",
// Per ulteriori informazioni sul campo 'console', vedere https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.7.0</Version>
<Version>1.7.2</Version>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>cv4pve-pepper</AssemblyName>
<Company>Corsinvest Srl</Company>
Expand All @@ -15,7 +15,9 @@
</PropertyGroup>

<ItemGroup>
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="8.2.0" />
<!-- <ProjectReference
Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj"
/> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="8.2.1" />
</ItemGroup>
</Project>
9 changes: 8 additions & 1 deletion src/Corsinvest.ProxmoxVE.Pepper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using System;
using System.CommandLine;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -65,7 +66,13 @@
if (app.DebugIsActive()) { await Console.Out.WriteLineAsync($"VM is {vm.Status}."); }
}

var (success, reasonPhrase, content) = await client.Nodes[vm.Node].Qemu[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy);
var (success, reasonPhrase, content) = vm.VmType switch
{
VmType.Qemu => await client.Nodes[vm.Node].Qemu[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy),
VmType.Lxc => await client.Nodes[vm.Node].Lxc[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy),
_ => throw new InvalidEnumArgumentException(),
};

if (success)
{
//proxy force
Expand Down

0 comments on commit 16c5d32

Please sign in to comment.