From e3d9be7601e6eeff53d57c9a09d392577ba64ebb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 19 Feb 2022 15:59:59 +0100 Subject: zfssnap: ... --- modules/zfssnap/zfssnap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/zfssnap/zfssnap.py b/modules/zfssnap/zfssnap.py index 6daf11ff..1c3e1f9a 100644 --- a/modules/zfssnap/zfssnap.py +++ b/modules/zfssnap/zfssnap.py @@ -233,11 +233,12 @@ def autosnap(): do_snapshot(*single) if recursive: do_snapshot(*recursive, recursive=True) + if not single and not recursive: + logger.warning('No snapshots to create') for snap in all_snap_names: logger.info(f'Created ‘{snap}’') - else: - logger.warn('No snapshots to create') - rename(snapshots=all_snap_names) + if all_snap_names: + rename(snapshots=all_snap_names) def main(): global logger -- cgit v1.2.3