Skip to content

Commit

Permalink
Merge pull request #50 from mariux64/make-mxraid_assemble-confidentia…
Browse files Browse the repository at this point in the history
…l-aware

Make mxraid assemble confidential aware
  • Loading branch information
thomas authored Aug 7, 2018
2 parents c4f318b + f70da1d commit fc217ba
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mxraid/mxraid_assemble
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ my $MDADM_CONF_BASE = '/dev/shm/mdadm.conf'; # config for mdadm, created with in

my $MDADM_ASSEMBLE_OPTIONS = '';

my $cd = MxRaid::ConfData->new($MDADMCONF_DB); $cd->verbose($VERBOSE);
my $cd = MxRaid::ConfData->new($MDADMCONF_DB); $cd->verbose($VERBOSE); $cd->load();
my $hd = MxRaid::HostData->new($cd); $hd->verbose($VERBOSE);
my $utils = MxRaid::Utils->new();

Expand Down Expand Up @@ -151,15 +151,15 @@ if ($opts{n}) {
}

# warn "# NOTE: got $cnt disk(s), default is 16.\n" if $cnt != 16;
# warn "# NOTE: label '$opts{n}' doesn't look good.\n" unless $opts{n} =~ m/^[DM][\da-f]\d{3}$/;
# warn "# NOTE: label '$opts{n}' doesn't look good.\n" unless $opts{n} =~ m/^[CDM][\da-f]\d{3}$/;
if ($cnt != 16) {
my $msg = "got $cnt disk(s), default is 16.";
$msg = $color->t_red($msg) unless $opts{m};
print "# NOTE: $msg\n";
}


if ($opts{n} !~ m/^[DM][\da-f]\d{3}$/) {
if ($opts{n} !~ m/^[CDM][\da-f]\d{3}$/) {
my $msg = "label '$opts{n}' doesn't look good.";
$msg = $color->t_red($msg) unless $opts{m};
print "# NOTE: $msg\n";
Expand Down Expand Up @@ -365,7 +365,6 @@ exit;
$self->{verbose} = 0;
$self->{db} = {};
$self->{lookup} = undef;
$self->load();
return $self;
}

Expand All @@ -387,7 +386,7 @@ exit;

@rec = split m/\s+/, $_;

if ($rec[0] !~ m/[DM][\da-f]\d{3}:/) {
if ($rec[0] !~ m/[CDM][\da-f]\d{3}:/) {
warn "# NOTE: raid name not in expected format (bad key '$rec[0]' at line $lines).\n" if $self->{verbose} >= 1;
next;
}
Expand Down Expand Up @@ -455,8 +454,9 @@ exit;
my $self = shift;
my %tmp;
for (keys %{$self->{db}}) {
my ($cat,$size,$num) = $_ =~ m/([DM])([\da-f])(\d{3})/;
next unless defined $cat and defined $num;
my ($cat,$size,$num) = $_ =~ m/([CDM])([\da-f])(\d{3})/;
next unless defined $num;
$cat = '(C/M)' if $cat ne 'D';
if (exists $tmp{"$cat$size"} and $tmp{"$cat$size"} > $num) {
$num = $tmp{"$cat$size"};
}
Expand Down

0 comments on commit fc217ba

Please sign in to comment.