Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3437 clean up login logout code for powerconnect.rb #3438

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ 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
- fortios: support for FortiADC (@electrocret)

### 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
Expand Down
15 changes: 10 additions & 5 deletions lib/oxidized/model/powerconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PowerConnect < Oxidized::Model
end

cmd 'show running-config' do |cfg|
cfg.sub(/^(sflow \S+ destination owner \S+ timeout )\d+$/, '! \1<timeout>')
cfg.sub(/^(sflow \S+ destination owner \S+ timeout )\d+$/, '! \1<timeout>') # Remove changing timeout
end

cfg :telnet, :ssh do
Expand All @@ -52,10 +52,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)
Expand Down