mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
Merge pull request #963 from darrenxyli/patch-1
Mac address finding precondition checker fix.
This commit is contained in:
@@ -39,13 +39,13 @@ func (l *LocalNode) Ready() error {
|
||||
|
||||
func NewLocalNode(ip string, identify string, identifyTypeString string) (node *LocalNode, err error) {
|
||||
addrs, err := sockaddr.GetPrivateInterfaces()
|
||||
if len(addrs) == 0 {
|
||||
return node, errors.New("address not found")
|
||||
}
|
||||
if ip == "" {
|
||||
if err != nil {
|
||||
return node, err
|
||||
}
|
||||
if len(addrs) == 0 {
|
||||
return node, errors.New("address not found")
|
||||
}
|
||||
ipaddr := *sockaddr.ToIPAddr(addrs[0].SockAddr)
|
||||
ip = ipaddr.NetIP().String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user