mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
Fixed port not being added to probing request
This commit is contained in:
parent
7beb7a33fc
commit
bc01412b08
1 changed files with 3 additions and 3 deletions
|
|
@ -57,7 +57,7 @@ func ScanForAssets(params *ScanParams) []RemoteAsset {
|
||||||
)
|
)
|
||||||
|
|
||||||
if params.Verbose {
|
if params.Verbose {
|
||||||
log.Info().Msg("starting scan...")
|
log.Info().Any("args", params).Msg("starting scan...")
|
||||||
}
|
}
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
@ -83,7 +83,7 @@ func ScanForAssets(params *ScanParams) []RemoteAsset {
|
||||||
if !params.DisableProbing {
|
if !params.DisableProbing {
|
||||||
assetsToAdd := []RemoteAsset{}
|
assetsToAdd := []RemoteAsset{}
|
||||||
for _, foundAsset := range foundAssets {
|
for _, foundAsset := range foundAssets {
|
||||||
url := fmt.Sprintf("%s://%s/redfish/v1/", params.Scheme, foundAsset.Host)
|
url := fmt.Sprintf("%s://%s:%d/redfish/v1/", params.Scheme, foundAsset.Host, foundAsset.Port)
|
||||||
res, _, err := util.MakeRequest(nil, url, http.MethodGet, nil, nil)
|
res, _, err := util.MakeRequest(nil, url, http.MethodGet, nil, nil)
|
||||||
if err != nil || res == nil {
|
if err != nil || res == nil {
|
||||||
if params.Verbose {
|
if params.Verbose {
|
||||||
|
|
@ -202,7 +202,7 @@ func rawConnect(address string, protocol string, timeoutSeconds int, keepOpenOnl
|
||||||
)
|
)
|
||||||
|
|
||||||
// try to conntect to host (expects host in format [10.0.0.0]:443)
|
// try to conntect to host (expects host in format [10.0.0.0]:443)
|
||||||
target := fmt.Sprintf("[%s]:%s", uri.Hostname(), uri.Port())
|
target := fmt.Sprintf("%s:%s", uri.Hostname(), uri.Port())
|
||||||
conn, err := net.DialTimeout(protocol, target, timeoutDuration)
|
conn, err := net.DialTimeout(protocol, target, timeoutDuration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
asset.State = false
|
asset.State = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue