mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-08 04:14:28 +00:00
cleanup previous commit - use IO::File
This commit is contained in:
parent
15b21acc0d
commit
46f58b5f03
@ -1126,15 +1126,15 @@ sub print_drivedevice_full {
|
||||
}
|
||||
|
||||
sub get_initiator_name {
|
||||
my $initiator = undef;
|
||||
my $initiator;
|
||||
|
||||
open (FILE, '/etc/iscsi/initiatorname.iscsi') or return undef;
|
||||
while (<FILE>) {
|
||||
next unless m/^\s*InitiatorName\s*=\s*([\.\-:\w]+)/;
|
||||
my $fh = IO::File->new('/etc/iscsi/initiatorname.iscsi') || return undef;
|
||||
while (defined(my $line = <$fh>)) {
|
||||
next if $line !~ m/^\s*InitiatorName\s*=\s*([\.\-:\w]+)/;
|
||||
$initiator = $1;
|
||||
last;
|
||||
}
|
||||
close FILE;
|
||||
$fh->close();
|
||||
|
||||
return $initiator;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user