Skip to content

Commit

Permalink
mxmirror: stricter assembly regexes
Browse files Browse the repository at this point in the history
After some discussion, the name of assemblies is
a capital letter followed by four digits, where the
first digit resembles the single disk size in Gb.
A 10Gb disk will get an 'a', so we can steal away with
hex-digits at the first place.

Thus /[XCMD][\da-f]\d\d\d/ should be used at every place,
where assemblies are handled.
  • Loading branch information
thomas authored and david committed Apr 9, 2018
1 parent 2b1a064 commit b84ff83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mxmirror/mxmirror
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ sub convert_to_sourcepath {

my ($jbod, $path, $host, $hostpath, $partition);

if(($jbod, $path) = $string =~ /^([XCMD]\d+)(.*?)$/) {
if(($jbod, $path) = $string =~ /^([XCMD][\da-f]\d\d\d)(.*?)$/) {
unless(defined $jbodmap->{$jbod}) {
printf STDERR "**ERROR: unknown jbod: $string";
next;
Expand Down Expand Up @@ -712,7 +712,7 @@ sub convert_to_destinationpath {

my ($jbod, $path, $host, $hostpath, $partition);

if(($jbod, $path) = $string =~ /^([XCMD]\d+)(.*?)$/) {
if(($jbod, $path) = $string =~ /^([XCMD][\da-f]\d\d\d)(.*?)$/) {
unless(defined $jbodmap->{$jbod}) {
printf STDERR "**ERROR: unknown jbod: $string";
next;
Expand Down Expand Up @@ -882,7 +882,7 @@ sub read_jbodmap {
my $map = {};
foreach(<F>) {
next unless (m(/amd/(.*?)/[XCMD]/([XCMD]\d+)));
next unless (m(/amd/(.*?)/[XCMD]/([XCMD][\da-f]\d\d\d)));
$map->{$2} = $1;
}
Expand Down

0 comments on commit b84ff83

Please sign in to comment.