summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-12-06 17:04:24 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-14 23:59:21 +0000
commite871075895bb516f3b9c376fa24634ad586e6c09 (patch)
tree1f4dd1f925da4bb75a6781a5338879f7bbfe869d /libpod
parentff9c965335af0258bd34edae31699a87a03689a9 (diff)
downloadpodman-e871075895bb516f3b9c376fa24634ad586e6c09.tar.gz
podman-e871075895bb516f3b9c376fa24634ad586e6c09.tar.bz2
podman-e871075895bb516f3b9c376fa24634ad586e6c09.zip
Fix unit tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #109 Approved by: mheon
Diffstat (limited to 'libpod')
-rw-r--r--libpod/sql_state.go8
1 files changed, 4 insertions, 4 deletions
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")