|
|
|
@ -53,7 +53,7 @@ func (err CephMissingMonitorError) Error() string {
|
|
|
|
|
|
|
|
|
|
func (err *CephMissingMonitorError) writeNames(w *strings.Builder) { |
|
|
|
|
if len(err.Names) > 0 { |
|
|
|
|
_, _ = w.WriteString(" mon_host:") |
|
|
|
|
_, _ = w.WriteString(" mon_initial_members:") |
|
|
|
|
for i, name := range err.Names { |
|
|
|
|
if i != 0 { |
|
|
|
|
_, _ = w.WriteRune(',') |
|
|
|
@ -64,7 +64,8 @@ func (err *CephMissingMonitorError) writeNames(w *strings.Builder) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (err *CephMissingMonitorError) writeAddrs(w *strings.Builder) { |
|
|
|
|
_, _ = w.WriteString(" mon_initial_members:") |
|
|
|
|
if len(err.Addrs) > 0 { |
|
|
|
|
_, _ = w.WriteString(" mon_host:") |
|
|
|
|
for i, addr := range err.Addrs { |
|
|
|
|
if i != 0 { |
|
|
|
|
_, _ = w.WriteRune(',') |
|
|
|
@ -72,6 +73,7 @@ func (err *CephMissingMonitorError) writeAddrs(w *strings.Builder) {
|
|
|
|
|
_, _ = w.WriteString(addr.String()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// AsError returns nil if the instance is actually OK
|
|
|
|
|
func (err *CephMissingMonitorError) AsError() error { |
|
|
|
@ -172,5 +174,10 @@ func (m *Zones) scanCephMonitors(_ *ScanOptions) error {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// make sure every zone has one
|
|
|
|
|
m.ForEachZone(func(z *Zone) bool { |
|
|
|
|
_ = z.GetCephMonitors() |
|
|
|
|
return false |
|
|
|
|
}) |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|