Like similar previous patches, make "stg export" distinguish between an
unapplied patch and a non-existent one when reporting a failure.
Signed-off-by: Chuck Lever <cel@netapp.com>
if start in applied:
start_idx = applied.index(start)
else:
if start in applied:
start_idx = applied.index(start)
else:
- raise CmdException, 'Patch "%s" not applied' % start
+ if start in unapplied:
+ raise CmdException, 'Patch "%s" not applied' % start
+ else:
+ raise CmdException, 'Patch "%s" does not exist' % start
+
if stop in applied:
stop_idx = applied.index(stop) + 1
else:
if stop in applied:
stop_idx = applied.index(stop) + 1
else:
- raise CmdException, 'Patch "%s" not applied' % stop
+ if stop in unapplied:
+ raise CmdException, 'Patch "%s" not applied' % stop
+ else:
+ raise CmdException, 'Patch "%s" does not exist' % stop
if start_idx >= stop_idx:
raise CmdException, 'Incorrect patch range order'
if start_idx >= stop_idx:
raise CmdException, 'Incorrect patch range order'