Oliver,
The problem occurs when your disconnect() needs to send a disconnect
command to the remote device (some of our Cisco devices have issues if you
disconnect without calling 'exit' first). open() calls close() to ensure
that you're not already open. close() calls disconnect().
disconnect() tries to write a disconnect command to a
filehandle which isn't open, and it dies with an error message.
Of couse the proper fix is for this check to be in Net::Telnet::open(),
but hey ho.
Steve
On Sat, 5 Feb 2011, Oliver Gorwits via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=65453 >
>
> On Fri Feb 04 12:39:00 2011, STEVEC wrote:
>> Adding the code below to the top of Net::Appliance::Session::close()
>> prevents it from doing anything unless it's actually in an open session.
>>
>> # Just return if we're in an open session.
>> my $s = *$self->{net_telnet};
>> return unless $s->{opened};
>
> Many thanks for this.
>
> I'm interested: is it that the module is calling close() when it shouldn't do (i.e. when there is no
> connection), or this is protection against the user calling close() in the wrong situation?
>
> regards,
> oliver.
>
>