From 3540dc309c70250626b671336f65e0c429f4c083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Wed, 6 Apr 2022 14:04:00 +0000 Subject: [PATCH] enh: groupInfo: clearer message for disabled idle/kill timeout policies --- bin/plugin/open/groupInfo | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/plugin/open/groupInfo b/bin/plugin/open/groupInfo index c67c2be..dcf61f8 100755 --- a/bin/plugin/open/groupInfo +++ b/bin/plugin/open/groupInfo @@ -184,15 +184,25 @@ if ( OVH::Bastion::is_group_owner(group => $shortGroup, account => $self, supe $fnret = OVH::Bastion::group_config(group => $group, %{OVH::Bastion::OPT_GROUP_IDLE_KILL_TIMEOUT()}); if ($fnret && defined $fnret->value && $fnret->value =~ /^-?\d+$/) { - osh_warn "Specific idle kill timeout: idle sessions on servers of this group will be cut after " - . OVH::Bastion::duration2human(seconds => $fnret->value)->value->{'duration'}; + if ($fnret->value == 0) { + osh_warn "Specific idle kill timeout: idle sessions on servers of this group will NOT be cut"; + } + else { + osh_warn "Specific idle kill timeout: idle sessions on servers of this group will be cut after " + . OVH::Bastion::duration2human(seconds => $fnret->value)->value->{'duration'}; + } $result_hash->{'idle_kill_timeout'} = $fnret->value; } $fnret = OVH::Bastion::group_config(group => $group, => %{OVH::Bastion::OPT_GROUP_IDLE_LOCK_TIMEOUT()}); if ($fnret && defined $fnret->value && $fnret->value =~ /^-?\d+$/) { - osh_warn "Specific idle lock timeout: idle sessions on servers of this group will be locked after " - . OVH::Bastion::duration2human(seconds => $fnret->value)->value->{'duration'}; + if ($fnret->value == 0) { + osh_warn "Specific idle lock timeout: idle sessions on servers of this group will NOT be locked"; + } + else { + osh_warn "Specific idle lock timeout: idle sessions on servers of this group will be locked after " + . OVH::Bastion::duration2human(seconds => $fnret->value)->value->{'duration'}; + } $result_hash->{'idle_lock_timeout'} = $fnret->value; } }