$raw isn't used anywhere here and probably just a left over from copy
pasting, and the "int cast ternary" can be avoided by just directly
casting to int when assigning the variable in the first place.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
die "OSD '${osdid}' does not exists on host '${nodename}'\n"
if $nodename ne $metadata->{hostname};
- my $raw = '';
my $pid;
my $parser = sub {
my $line = shift;
if ($line =~ m/^MainPID=([0-9]*)$/) {
- $pid = $1;
+ $pid = int($1);
}
};
];
run_command($cmd, errmsg => 'fetching OSD PID and memory usage failed', outfunc => $parser);
- $pid = defined($pid) ? int($pid) : undef;
-
my $memory = 0;
if ($pid && $pid > 0) {
open (my $SMAPS, '<', "/proc/$pid/smaps_rollup")