mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 12:11:26 +00:00
scstadmin: Make -write_config save the scst_local session name
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4304 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2824,6 +2824,19 @@ sub targetAttributes {
|
||||
$linked =~ s/.*\///;
|
||||
$attributes{$attribute}->{'static'} = TRUE;
|
||||
$attributes{$attribute}->{'value'} = $linked;
|
||||
} elsif ($driver eq 'scst_local' && $attribute eq 'sessions') {
|
||||
my $_session_path = make_path($_path, $attribute);
|
||||
my $pSessHandle = new IO::Handle;
|
||||
if (!(opendir $pSessHandle, $_session_path)) {
|
||||
$self->{'err_string'} = "targetAttributes(): Unable to read directory '$_session_path': $!";
|
||||
return undef;
|
||||
}
|
||||
my $session_name;
|
||||
foreach my $e (readdir($pSessHandle)) {
|
||||
next if ($e eq '.' || $e eq '..');
|
||||
$session_name = $e;
|
||||
}
|
||||
$attributes{'session_name'}->{'keys'}->{'0'}->{'value'} = $session_name;
|
||||
} elsif (-d $pPath) {
|
||||
# Skip directories
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user