Commit e598c02e authored by Sebastian Stark's avatar Sebastian Stark

make TestParseSnapshotName pass

  - incomplete snapshots should never have a non-zero end time
parent 64ecf7df
......@@ -217,6 +217,9 @@ func parseSnapshotName(s string) (time.Time, time.Time, SnapshotState, error) {
if state == 0 {
return time.Unix(stime, 0), time.Unix(etime, 0), state, errors.New("could not parse state: " + s)
}
if state == STATE_INCOMPLETE && etime != 0 {
return zero, zero, 0, errors.New("incomplete state but non-zero end time: " + s)
}
return time.Unix(stime, 0), time.Unix(etime, 0), state, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment