discover.ScanAndConnect errors if a BMC doesn't have a web endpoint on port 443
jacobweinstock opened this issue · 0 comments
jacobweinstock commented
discover.ScanAndConnect
fails if the BMC host doesn't have a service to connect to on port 443.
Get "https://127.0.0.1/xmldata?item=all": dial tcp 127.0.0.1:443: connect: connection refused
How to reproduce:
# start a ipmi simulator
docker run -d -p 623:623/udp vaporio/ipmi-simulator
# edit examples/main.go with local bmc connection details
sed -i.bak 's/ip := "<bmc_ip>"/ip := "127.0.0.1"/g' examples/main.go
sed -i.bak 's/user := "user"/user := "ADMIN"/g' examples/main.go
sed -i.bak 's/pass := "password"/pass := "ADMIN"/g' examples/main.go
rm -rf example/main.go.bak
# run the main.go example
go run examples/main.go
FATA[0000] Get "https://127.0.0.1/xmldata?item=all": dial tcp 127.0.0.1:443: connect: connection refused
exit status 1
Expected behavior:
I would expect that if a BMC doesn't server anything on port 443 then, that specific provider would fail out with a errors.ErrDeviceNotMatched
or similar but not to fail the discovery process. Something possibly like this:
go run examples/main.go
FATA[0000] unable to identify the vendor