Skip to content

Commit 6f7a098

Browse files
author
Marcin Przepiorowski
committed
fix for held storage reporting if there is more objects
1 parent e8df29b commit 6f7a098

File tree

2 files changed

+100
-68
lines changed

2 files changed

+100
-68
lines changed

bin/dx_get_capacity.pl

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,26 +312,42 @@
312312

313313
}
314314

315-
my $held_hash = $capacity->getDetailedDBUsage("Heldspace", undef);
315+
my $held_array = $capacity->getStorageContainers();
316316

317-
if ($held_hash->{totalsize} ne 0) {
318317

319-
my @printarray = (
320-
$engine,
321-
$held_hash->{group_name},
322-
"Held space - " . $held_hash->{storageContainer},
323-
"N/A",
324-
sprintf("%10.2f", $held_hash->{totalsize})
325-
);
326318

327-
# make sure all columns for detail view are filled with ''
328-
if (($output->getHeaderSize() - scalar(@printarray)) gt 0) {
329-
push @printarray, ('') x ($output->getHeaderSize() - scalar(@printarray)) ;
330-
}
319+
if (scalar(@{$held_array}) > 0) {
320+
321+
my $held_hash;
322+
323+
for my $hs (@{$held_array}) {
324+
325+
$held_hash = $capacity->getDetailedDBUsage($hs, undef);
331326

332-
$output->addLine(
333-
@printarray
334-
);
327+
my $groupname;
328+
if (defined($held_hash->{group_name})) {
329+
$groupname = $held_hash->{group_name};
330+
} else {
331+
$groupname = 'N/A';
332+
}
333+
334+
my @printarray = (
335+
$engine,
336+
$groupname,
337+
"Held space - " . $held_hash->{storageContainer},
338+
"N/A",
339+
sprintf("%10.2f", $held_hash->{totalsize})
340+
);
341+
342+
# make sure all columns for detail view are filled with ''
343+
if (($output->getHeaderSize() - scalar(@printarray)) gt 0) {
344+
push @printarray, ('') x ($output->getHeaderSize() - scalar(@printarray)) ;
345+
}
346+
347+
$output->addLine(
348+
@printarray
349+
);
350+
}
335351
}
336352

337353

0 commit comments

Comments
 (0)