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

Fix for getting MAC table over SSH on recent ONIE switches #7464

Merged
merged 1 commit into from
Aug 9, 2024
Merged
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 perl-xCAT/xCAT/MacMap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ sub refresh_switch {
my $mymac;
my $myport;

my @res=xCAT::Utils->runcmd("ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $switch 'bridge fdb show|grep -i -v permanent|tr A-Z a-z 2>/dev/null' 2>/dev/null",-1);
my @res=xCAT::Utils->runcmd("ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $switch \"bash -lc 'set -o pipefail; bridge fdb show |grep -i -v permanent |tr A-Z a-z 2>/dev/null'\" 2>/dev/null",-1);
if ($::RUNCMD_RC) {
xCAT::MsgUtils->message("S", "Failed to get mac table with ssh to $switch, fall back to snmp! To obtain mac table with ssh, please make sure the passwordless root ssh to $switch is available");
if ($self->{collect_mac_info}) {
Expand Down Expand Up @@ -774,6 +774,7 @@ sub refresh_switch {
}
}


my $session = $self->getsnmpsession('community' => $community, 'switch' => $switch);
unless ($session) {
xCAT::MsgUtils->message("S", "Failed to communicate with $switch");
Expand Down