Skip to content

Commit

Permalink
This makes it more clear (at least to me ;-) which commands are waiti…
Browse files Browse the repository at this point in the history
…ng 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
  • Loading branch information
clifcox committed Mar 1, 2025
1 parent 3606d59 commit 835d7fd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/oxidized/model/powerconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<timeout>')
cfg.sub(/^(sflow \S+ destination owner \S+ timeout )\d+$/, '! \1<timeout>') # Remove changing timeout
cfg
end

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

0 comments on commit 835d7fd

Please sign in to comment.