Browse code

Error when using --delete-only and --dry-run

Lorenz Hüdepohl authored on07/06/2015 20:17:37
Showing1 changed files
... ...
@@ -119,7 +119,9 @@ for line in zfs_props.stdout:
119 119
             if snapname.startswith("{0}@autosnapshot-{1}-".format(fs, args.tagname)):
120 120
                 snapshots.append(snapname)
121 121
 
122
-        if args.dry_run:
122
+        # in dry-run mode, the not-created snapshot does not appear
123
+        # in the output of zfs, append it manually
124
+        if args.dry_run and not args.delete_only:
123 125
             snapshots.append(new_snapshot)
124 126
 
125 127
         to_delete = snapshots[:-number]