From 6f698625db631759c2c9471d4f66d7cd35805860 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 24 Jan 2017 15:43:31 -0500 Subject: [PATCH 1/2] xdsh doesn't read credentials from the passwd table for IBSwitch --- perl-xCAT/xCAT/DSHCLI.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index a0b5788c9..0c98e7908 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -979,8 +979,9 @@ sub fork_fanout_dsh ) = @_; - #get username and passeword for ether net switches (EthSwitch type) - if ($$options{'devicetype'} =~ /EthSwitch/) { + #get username and passeword for switches + if (($$options{'devicetype'} =~ /EthSwitch/) { + ($$options{'devicetype'} =~ /IBSwitch/) ){ if (@$targets_waiting > 0) { if ($ENV{'DSH_REMOTE_PASSWORD'}) { foreach my $t (keys(%$resolved_targets)) { @@ -1010,13 +1011,15 @@ sub fork_fanout_dsh if (defined($entry->[0]->{protocol})) { $protocol = $entry->[0]->{protocol}; } - if ((!$username) && (!$password) && (!$protocol)) { #use passwd table as default + if ((!$username) && (!$password)) { #use passwd table as default if (defined($passwd_ent[0]->{username})) { $username = $passwd_ent[0]->{username}; } if (defined($passwd_ent[0]->{password})) { $password = $passwd_ent[0]->{password}; } + } + if (!$protocol){ if (defined($passwd_ent[0]->{comments}) && ($passwd_ent[0]->{comments} eq "telnet")) { $protocol = $passwd_ent[0]->{comments}; } From 8782186f6be4be3fc6c1aca3786ef1ae7d2b973e Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 24 Jan 2017 16:05:01 -0500 Subject: [PATCH 2/2] check if there is "-l" options --- perl-xCAT/xCAT/DSHCLI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 0c98e7908..8121f475d 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -980,8 +980,8 @@ sub fork_fanout_dsh = @_; #get username and passeword for switches - if (($$options{'devicetype'} =~ /EthSwitch/) { - ($$options{'devicetype'} =~ /IBSwitch/) ){ + if (($$options{'devicetype'} =~ /EthSwitch/) || + (($$options{'devicetype'} =~ /IBSwitch/) && !($$options{'user'})) ){ if (@$targets_waiting > 0) { if ($ENV{'DSH_REMOTE_PASSWORD'}) { foreach my $t (keys(%$resolved_targets)) {