mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 20:56:24 +00:00
scstadmin: Eliminate use of uninitialized value in numeric error
Using scstadmin to reload a configuration with fewer targets can result in a "Use of uninitialized value in numeric ne" error. Rectify by adding a check for the undefined value and handling the situation (by disabling the target in question, unless the driver is copy_manager).
This commit is contained in:
committed by
Gleb Chesnokov
parent
2f9a82bb87
commit
f4f8da8b4d
@@ -2831,10 +2831,17 @@ sub applyConfigEnableTargets {
|
|||||||
my $t_attributes;
|
my $t_attributes;
|
||||||
($t_attributes, $errorString) = $SCST->targetAttributes($driver, $target);
|
($t_attributes, $errorString) = $SCST->targetAttributes($driver, $target);
|
||||||
|
|
||||||
if (defined($$t_attributes{'enabled'}) &&
|
if (defined($$attributes{'enabled'})) {
|
||||||
($$t_attributes{'enabled'}->{'value'} != $$attributes{'enabled'})) {
|
if (defined($$t_attributes{'enabled'}) &&
|
||||||
setTargetAttribute($driver, $target, 'enabled', $$attributes{'enabled'});
|
($$t_attributes{'enabled'}->{'value'} != $$attributes{'enabled'})) {
|
||||||
$changes++;
|
setTargetAttribute($driver, $target, 'enabled', $$attributes{'enabled'});
|
||||||
|
$changes++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($driver ne 'copy_manager') {
|
||||||
|
setTargetAttribute($driver, $target, 'enabled', 0);
|
||||||
|
$changes++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user