Переглянути джерело

subnet/etcdv2/local_manager.go: Fix startup log

Print "None" instead of 0.0.0.0/0 if there's no previous subnet to use

Fixes #767
Tom Denham 7 роки тому
батько
коміт
a7ca2a096a
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      subnet/etcdv2/local_manager.go

+ 5 - 1
subnet/etcdv2/local_manager.go

@@ -378,5 +378,9 @@ func isSubnetConfigCompat(config *Config, sn ip.IP4Net) bool {
 }
 
 func (m *LocalManager) Name() string {
-	return fmt.Sprintf("Etcd Local Manager with Previous Subnet: %s", m.previousSubnet.String())
+	previousSubnet := m.previousSubnet.String()
+	if m.previousSubnet.Empty() {
+		previousSubnet = "None"
+	}
+	return fmt.Sprintf("Etcd Local Manager with Previous Subnet: %s", previousSubnet)
 }