From 255f0c84b1068ea4382773b7494cb18c8cf3c085 Mon Sep 17 00:00:00 2001 From: clifcox Date: Wed, 26 Feb 2025 17:59:20 -0800 Subject: [PATCH 1/4] Update CHANGELOG.md Added model for Unifi / AirOS APs and some Unifi switches --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66db73dfe..e61b80afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] ### Added +- model for Unifi / AirOS APs and some Unifi switches. Re: #3430 (@clifcox) ### Changed - docker image: updated github CI to explicitly build tag versions (@robertcheramy) From 835d7fd836d41516379e94d32bcb7bf456ee1ad0 Mon Sep 17 00:00:00 2001 From: Clif Cox Date: Fri, 28 Feb 2025 16:33:18 -0800 Subject: [PATCH 2/4] This makes it more clear (at least to me ;-) which commands are waiting for a prompt and which ones are not, (sends). I looked for documentation on post_login, and pre_logout but didn't find anything. Also, I'm pretty sure the cli logout command needs to come after the last exit, not before. So I switched the order there, and added a little delay just for good luck. Lastly I added a comment on filtering out a timeout. Clif --- lib/oxidized/model/powerconnect.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index 86edac07f..4a67e5e23 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -34,7 +34,8 @@ class PowerConnect < Oxidized::Model end cmd 'show running-config' do |cfg| - cfg.sub(/^(sflow \S+ destination owner \S+ timeout )\d+$/, '! \1') + cfg.sub(/^(sflow \S+ destination owner \S+ timeout )\d+$/, '! \1') # Remove changing timeout + cfg end cfg :telnet, :ssh do @@ -52,10 +53,15 @@ class PowerConnect < Oxidized::Model end end - post_login "terminal datadump" - post_login "terminal length 0" - pre_logout "logout" - pre_logout "exit" + post_login do + cmd "terminal datadump" + cmd "terminal length 0" + end + pre_logout do + send "exit\r" + sleep(0.25) + send "logout\r" + end end def clean(cfg) From 25cdcfe65a5c965e3446ebe93d0cda5e84a6358a Mon Sep 17 00:00:00 2001 From: clifcox Date: Fri, 28 Feb 2025 16:55:09 -0800 Subject: [PATCH 3/4] Update CHANGELOG.md powerconnect: Cleanup login/logout logic. Fixes #3437 (@clifcox) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a57e92b5..afd26f158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Fixed - powerconnect: Mask the changing temperature issue for non-stacked switches. Fixes #2088 (@clifcox) - +- powerconnect: Cleanup login/logout logic. Fixes #3437 (@clifcox) ## [0.32.2 – 2025-02-27] This patch release mainly fixes the docker building process, wich resulted in From f7a9312864c9058000bad74edb1d2f7f5fe1b645 Mon Sep 17 00:00:00 2001 From: Clif Cox Date: Fri, 28 Feb 2025 17:11:28 -0800 Subject: [PATCH 4/4] Opps accidentally added a line. --- lib/oxidized/model/powerconnect.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index 4a67e5e23..9dead8a5e 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -35,7 +35,6 @@ class PowerConnect < Oxidized::Model cmd 'show running-config' do |cfg| cfg.sub(/^(sflow \S+ destination owner \S+ timeout )\d+$/, '! \1') # Remove changing timeout - cfg end cfg :telnet, :ssh do