Browse Source

etcdctl: snapshot status error for non-existent file

Gyu-Ho Lee 9 years ago
parent
commit
a78ece4ac2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      etcdctl/ctlv3/command/snapshot_command.go

+ 4 - 0
etcdctl/ctlv3/command/snapshot_command.go

@@ -297,6 +297,10 @@ type dbstatus struct {
 }
 
 func dbStatus(p string) dbstatus {
+	if _, err := os.Stat(p); err != nil {
+		ExitWithError(ExitError, err)
+	}
+
 	ds := dbstatus{}
 
 	db, err := bolt.Open(p, 0600, nil)