From b40b098024733e54d80ba4563e5e64c6cc558c28 Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Wed, 7 Jun 2017 19:02:37 +0200 Subject: [PATCH] Fixed a bug that removed snapshots even if zfs send failed. Removed debug output --- bin/zsnapper | 1 + zsnaplib/__init__.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/zsnapper b/bin/zsnapper index 43267ad..5e6225d 100644 --- a/bin/zsnapper +++ b/bin/zsnapper @@ -210,6 +210,7 @@ def send_snapshots(fslist, snapshots, config, sudo): log.info('{} successfully sent to remote'.format(fs)) except zsnaplib.ZFSSnapshotError as e: log.warning(e) + failed_snapshots.add(fs) return failed_snapshots def weed_snapshots(fslist, snapshots, config, sudo, failed_snapshots): diff --git a/zsnaplib/__init__.py b/zsnaplib/__init__.py index f13a2fc..faa014a 100644 --- a/zsnaplib/__init__.py +++ b/zsnaplib/__init__.py @@ -46,7 +46,6 @@ def do_zfs_command(args, sudo, pipecmd=None, zfs_cmd=[zfs_bin]): (out, err) = ctrl_proc.communicate() if ctrl_proc.returncode != 0: - print(proc.returncode) raise ZFSSnapshotError('Failed to execute {}: {}'.format(cmd, err)) return out