From e871075895bb516f3b9c376fa24634ad586e6c09 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 6 Dec 2017 17:04:24 -0500 Subject: Fix unit tests Signed-off-by: Matthew Heon Closes: #109 Approved by: mheon --- libpod/sql_state.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libpod/sql_state.go') diff --git a/libpod/sql_state.go b/libpod/sql_state.go index 5248ee87a..9d457c3ec 100644 --- a/libpod/sql_state.go +++ b/libpod/sql_state.go @@ -511,6 +511,10 @@ func (s *SQLState) SaveContainer(ctr *Container) error { NetNSPath=? WHERE Id=?;` + if !ctr.valid { + return ErrCtrRemoved + } + netNSPath := "" if ctr.state.NetNS != nil { netNSPath = ctr.state.NetNS.Path() @@ -520,10 +524,6 @@ func (s *SQLState) SaveContainer(ctr *Container) error { return ErrDBClosed } - if !ctr.valid { - return ErrCtrRemoved - } - tx, err := s.db.Begin() if err != nil { return errors.Wrapf(err, "error beginning database transaction") -- cgit v1.2.3-54-g00ecf