Commit 7430218 1 parent 636e8e1 commit 7430218 Copy full SHA for 7430218
File tree 2 files changed +3
-3
lines changed
lib/GLPI/Agent/Task/Inventory/Virtualization
t/tasks/inventory/virtualization
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ sub _getVirtualMachine {
103
103
}
104
104
105
105
if ($key eq ' lxc.cgroup.memory.limit_in_bytes' || $key eq ' lxc.cgroup2.memory.max' ) {
106
- $val .= " b" if $val =~ / [KMGTP] $ / i ;
106
+ $val .= $val =~ / [KMGTP] $ / i ? " b" : $val =~ / ^ \d + $ / ? " bytes " : " " ;
107
107
$container -> {MEMORY } = getCanonicalSize($val , 1024);
108
108
}
109
109
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ my %container_tests = (
23
23
NAME => ' config' ,
24
24
VMTYPE => ' lxc' ,
25
25
STATUS => STATUS_OFF,
26
- MEMORY => ' 2048000 ' ,
26
+ MEMORY => ' 1 ' ,
27
27
MAC => ' 01:23:45:67:89:0a' ,
28
28
VCPU => 4
29
29
}
@@ -55,7 +55,7 @@ my %container_tests = (
55
55
VMTYPE => ' lxc' ,
56
56
STATUS => STATUS_RUNNING,
57
57
MAC => ' fa:ee:26:ef:6b:1c' ,
58
- MEMORY => 2147483648 ,
58
+ MEMORY => 2048 ,
59
59
VCPU => 2
60
60
}
61
61
},
You can’t perform that action at this time.
0 commit comments