-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After enabling VFs on host, changed the way to verify, (#238)
After enabling VFs on host, changed the way to verify, if those VFs came up fine. Previous way of ssh from host to IMC, to run cli_client is not reliable, since customer config may not support host to IMC connection.
- Loading branch information
1 parent
1738639
commit d81d578
Showing
2 changed files
with
51 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,32 +138,6 @@ func ImcQueryfindVsiGivenMacAddr(mode string, mac string) (string, error) { | |
return output, nil | ||
} | ||
|
||
func GetVfDeviceCount(mode string) (int, error) { | ||
var ipAddr string | ||
if mode == types.HostMode { | ||
ipAddr = hostToImcIpAddr | ||
} else if mode == types.IpuMode { | ||
ipAddr = accToImcIpAddr | ||
} | ||
|
||
runCommand := fmt.Sprintf(`ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 root@"%s" "/usr/bin/cli_client -cq" \ | ||
| awk '{if(($4 == "0x0") && ($6 == "yes")) {print $17}}'`, ipAddr) | ||
|
||
// reach out to the IMC to get the mac addresses of the VFs | ||
output, err := ExecuteScript(runCommand) | ||
|
||
if err != nil { | ||
return 0, fmt.Errorf("unable to reach the IMC %v", err) | ||
} | ||
|
||
vfMacList := strings.Split(strings.TrimSpace(output), "\n") | ||
length := len(vfMacList) | ||
if len(vfMacList) == 1 && vfMacList[0] == "" { | ||
length = length - 1 | ||
} | ||
return length, nil | ||
} | ||
|
||
func GetVfMacList() ([]string, error) { | ||
// reach out to the IMC to get the mac addresses of the VFs | ||
output, err := ExecuteScript(`ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 [email protected] "/usr/bin/cli_client -cq" \ | ||
|