Refactor Paxos status call to remove type assertion

This commit is contained in:
Bryan Boreham committed 2016-04-07 12:12:08 +01:00
1 parent 768e2a31fa
commit 0c59de40e7
4 files changed
+14 -6

No files matched your search

+4 -2
View File
@@ -37,8 +37,10 @@ func NewStatus(allocator *Allocator, defaultSubnet address.CIDR) *Status {
var paxosStatus *paxos.Status
if allocator.awaitingConsensus && allocator.paxos != nil {
if node, ok := allocator.paxos.(*paxos.Node); ok {
paxosStatus = paxos.NewStatus(node)
if allocator.paxos.IsElector() {
if node, ok := allocator.paxos.(*paxos.Node); ok {
paxosStatus = paxos.NewStatus(node)
}
}
}