From 8c3c747c620a988df73a0624955907fa706f9ea8 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Sat, 4 Jul 2015 16:48:09 -0700 Subject: [PATCH] Fix incorrect error handling in bitseq constructor - We must ignore key not found error when querying datastore for initial state. - Regression introduced by 04bd8f67ad8bcd96e6c9ddf49745d9eea1eae7aa Signed-off-by: Alessandro Boch --- libnetwork/bitseq/sequence.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libnetwork/bitseq/sequence.go b/libnetwork/bitseq/sequence.go index 03b98ff405..d9c9ad5272 100644 --- a/libnetwork/bitseq/sequence.go +++ b/libnetwork/bitseq/sequence.go @@ -55,12 +55,11 @@ func NewHandle(app string, ds datastore.DataStore, id string, numElements uint32 h.watchForChanges() // Get the initial status from the ds if present. - err := h.store.GetObject(datastore.Key(h.Key()...), h) - if err != datastore.ErrKeyNotFound { + if err := h.store.GetObject(datastore.Key(h.Key()...), h); err != nil && err != datastore.ErrKeyNotFound { return nil, err } - return h, err + return h, nil } // Sequence reresents a recurring sequence of 32 bits long bitmasks