Skip to content

Commit

Permalink
mxraid_assemble: Code cleanup
Browse files Browse the repository at this point in the history
Proper calls for 'configured_raids'.
  • Loading branch information
thomas committed Apr 30, 2018
1 parent 736b293 commit 169d60d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mxraid/mxraid_assemble
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if ($opts{c}) {
print "# NOTE: no active raids found.\n" unless @labels;
for my $label (@labels) {
print "$label:\n";
for my $rec (@{$hd->{configured_raids}{$label}}) { # todo write a proper accessor :xxx:
for my $rec (@{$hd->configured_raids()->{$label}}) {
printf " %5s %-16s '%s'\n", @$rec;
}
print "\n";
Expand Down Expand Up @@ -448,7 +448,7 @@ exit;
}
}
}
$self->{configured_raids} = \%configured_raids;
$self->configured_raids(\%configured_raids);
$self->non_raid_disks(\@non_raid);
$self->raid_labels( [ sort keys %raid_labels ] );
}
Expand Down Expand Up @@ -512,6 +512,12 @@ exit;
return $self->{non_raid_disks};
}

sub configured_raids() {
my $self = shift;
$self->{configured_raids} = shift if @_;
$self->{configured_raids};
}

sub member_serials {
my $self = shift;
my $label = shift;
Expand Down

0 comments on commit 169d60d

Please sign in to comment.