|
|
@ -3,6 +3,7 @@ package cluster |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"net/netip" |
|
|
|
"net/netip" |
|
|
|
|
|
|
|
"os" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
"time" |
|
|
@ -81,7 +82,30 @@ func (m *Machine) scan(_ *ScanOptions) error { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return nil |
|
|
|
return m.loadInactive() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (m *Machine) loadInactive() error { |
|
|
|
|
|
|
|
data, err := m.ReadLines("region") |
|
|
|
|
|
|
|
switch { |
|
|
|
|
|
|
|
case os.IsNotExist(err): |
|
|
|
|
|
|
|
// no file
|
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
case err != nil: |
|
|
|
|
|
|
|
// read error
|
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
// look for "none"
|
|
|
|
|
|
|
|
for _, r := range data { |
|
|
|
|
|
|
|
switch r { |
|
|
|
|
|
|
|
case "none": |
|
|
|
|
|
|
|
m.Inactive = true |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
m.Inactive = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// scanWrapUp is called once all machines have been scanned
|
|
|
|
// scanWrapUp is called once all machines have been scanned
|
|
|
|