mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
scstadmin: Fix parsing of the soft links under the 'exported' directory
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7580 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2612,19 +2612,26 @@ sub deviceAttributes {
|
||||
|
||||
my $linked = readlink make_path($pPath, $export);
|
||||
|
||||
my $t = SCST_TARGETS;
|
||||
my $g = SCST_GROUPS;
|
||||
my $l = SCST_LUNS;
|
||||
my ($driver, $target, $group, $lun) = "" x 4;
|
||||
|
||||
if ($linked =~ /.*\/(.+)\/(.+)\/$g\/(.+)\/$l\/(\d+)/) {
|
||||
my $driver = $1;
|
||||
my $target = $2;
|
||||
my $group = $3;
|
||||
my $lun = $4;
|
||||
|
||||
next if ($target eq 'copy_manager');
|
||||
$attributes{$attribute}->{'value'}->{$driver}->{$target}->{$group} = $lun;
|
||||
if ($linked =~ /^(\.\.\/)*$t\/([^\/]+)\/([^\/]+)\/$g\/([^\/]+)\/$l\/(\d+)$/) {
|
||||
$driver = $2;
|
||||
$target = $3;
|
||||
$group = $4;
|
||||
$lun = $5;
|
||||
} elsif ($linked =~ /^(\.\.\/)*$t\/([^\/]+)\/([^\/]+)\/$l\/(\d+)$/) {
|
||||
$driver = $2;
|
||||
$target = $3;
|
||||
$lun = $4;
|
||||
} else {
|
||||
print("internal error: could not parse $linked\n");
|
||||
next;
|
||||
}
|
||||
|
||||
next if ($driver eq 'copy_manager');
|
||||
$attributes{$attribute}->{'value'}->{$driver}->{$target}->{$group} = $lun;
|
||||
}
|
||||
if ($attributes{$attribute}->{'value'}) {
|
||||
$attributes{$attribute}->{'static'} = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user