Use a more lenient cluster config check (fixes #148)

This commit is contained in:
Jakob Borg
2014-04-22 16:41:40 +02:00
parent e73b7e0398
commit 71684bfa45
2 changed files with 4 additions and 12 deletions

View File

@@ -117,8 +117,6 @@ func compareClusterConfig(local, remote protocol.ClusterConfigMessage) error {
if lflags&protocol.FlagShareBits != rflags&protocol.FlagShareBits {
return ClusterConfigMismatch(fmt.Errorf("remote has different sharing flags for node %q in repository %q", node, repo))
}
} else {
return ClusterConfigMismatch(fmt.Errorf("remote is missing node %q in repository %q", node, repo))
}
}
} else {
@@ -126,14 +124,8 @@ func compareClusterConfig(local, remote protocol.ClusterConfigMessage) error {
}
}
for repo, rnodes := range rm {
if lnodes, ok := lm[repo]; ok {
for node := range rnodes {
if _, ok := lnodes[node]; !ok {
return ClusterConfigMismatch(fmt.Errorf("remote has extra node %q in repository %q", node, repo))
}
}
} else {
for repo := range rm {
if _, ok := lm[repo]; !ok {
return ClusterConfigMismatch(fmt.Errorf("remote has extra repository %q", repo))
}