Skip to content

Commit

Permalink
fix: lxd cpu limit can be surrounded by double quotes
Browse files Browse the repository at this point in the history
Closes #488
  • Loading branch information
g-bougard committed Sep 21, 2023
1 parent 8c854d9 commit 5462702
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/GLPI/Agent/Task/Inventory/Virtualization/Lxd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ sub _getVirtualMachineConfig {

if ($key eq 'limits.memory') {
$config->{MEMORY} = getCanonicalSize($val);
} elsif ($key eq 'limits.cpu') {
$config->{VCPU} = int($val);
} elsif ($key eq 'limits.cpu' && $val =~ /^"?(\d+)"?$/) {
$config->{VCPU} = int($1);
}

if ($key eq 'lxc.cgroup.cpuset.cpus') {
Expand Down

0 comments on commit 5462702

Please sign in to comment.