From 76c2b200ef0527d65c6a3262a95bbdf6271e93b9 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Thu, 2 Dec 2021 10:21:50 +0100 Subject: [PATCH] fix(paloalto/ssh): session remains (#3288) --- network/paloalto/ssh/custom/cli.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/network/paloalto/ssh/custom/cli.pm b/network/paloalto/ssh/custom/cli.pm index 57fb8c008..41866da11 100644 --- a/network/paloalto/ssh/custom/cli.pm +++ b/network/paloalto/ssh/custom/cli.pm @@ -90,7 +90,7 @@ sub execute_command { $self->{ssh_commands} = "set cli op-command-xml-output on\n" . - $options{command} . "\n"; + $options{command} . "\nexit\n"; my $stdout; if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { @@ -100,8 +100,7 @@ sub execute_command { command => defined($self->{option_results}->{command}) && $self->{option_results}->{command} ne '' ? $self->{option_results}->{command} : $self->{ssh_commands}, command_path => $self->{option_results}->{command_path}, command_options => defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne '' ? $self->{option_results}->{command_options} : undef, - timeout => $self->{option_results}->{timeout}, - cmd_exit => !defined($self->{option_results}->{command}) || $self->{option_results}->{command} eq '' ? "exit\n" : undef + timeout => $self->{option_results}->{timeout} ); } else { if (!defined($self->{option_results}->{command}) || $self->{option_results}->{command} eq '') {