hopefully fixed crash when snapshotting failed

This commit is contained in:
Fredrik Eriksson 2019-05-10 17:42:45 +02:00
parent a22c2d35f7
commit 53ccab0f0a
No known key found for this signature in database
GPG Key ID: 8825C73A0FD1502A

View File

@ -348,12 +348,14 @@ def main():
["{}@{}".format(x, remote) for x in remote_fs[remote]],
remote_snapshots[remote],
config)
except zsnaplib.ZFSSnapshotError:
except zsnaplib.ZFSSnapshotError as e:
if remote in remote_fs:
del remote_fs[remote]
if remote in remote_snapshots:
del remote_snapshots[remote]
log.warning("Failed to snapshot on {}".format(remote))
if remote in remotes:
del remotes[remote]
log.warning("Failed to snapshot on {}: {}".format(remote, e))
ret = RET_CODES['ERROR']
for remote, filesystems in failed_remote_snapshots.items():