Browse code

Error in sanity check before zfs destroy

Lorenz Hüdepohl authored on23/04/2015 17:02:54
Showing1 changed files
... ...
@@ -104,6 +104,6 @@ for line in zfs_props.stdout:
104 104
 
105 105
         for d in to_delete:
106 106
             # Delete this old snapshot
107
-            if not snapname.startswith("{0}@autosnapshot-{1}-".format(fs, args.tagname)):
108
-                raise Exception("Invalid snapshot name '{0}', does not start with '{1}@autosnapshot-{2}-'".format(snapname, fs, args.tagname))
107
+            if not d.startswith("{0}@autosnapshot-{1}-".format(fs, args.tagname)):
108
+                raise Exception("Invalid snapshot name '{0}', does not start with '{1}@autosnapshot-{2}-'".format(d, fs, args.tagname))
109 109
             check_call(zfs + ["destroy", d])