From 5271109cc4066415f058c70e28c5cbe136a9d183 Mon Sep 17 00:00:00 2001 From: Wes Barnett Date: Thu, 15 Apr 2021 20:20:48 -0400 Subject: [PATCH] update logging --- hooks/zz_snap-pac-install.hook | 28 ---------------------------- scripts/snap_pac.py | 8 +++++--- 2 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 hooks/zz_snap-pac-install.hook diff --git a/hooks/zz_snap-pac-install.hook b/hooks/zz_snap-pac-install.hook deleted file mode 100644 index 4beeb68..0000000 --- a/hooks/zz_snap-pac-install.hook +++ /dev/null @@ -1,28 +0,0 @@ -# snap-pac -# https://github.com/wesbarnett/snap-pac -# Copyright (C) 2016, 2017, 2018 James W. Barnett - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -[Trigger] -Operation = Install -Type = Package -Target = snap-pac - -[Action] -Description = You are installing snap-pac, so no post transaction snapshots will be taken. -Depends = snap-pac -When = PostTransaction -Exec = /usr/bin/true diff --git a/scripts/snap_pac.py b/scripts/snap_pac.py index b5b235b..77dbcc4 100755 --- a/scripts/snap_pac.py +++ b/scripts/snap_pac.py @@ -49,8 +49,9 @@ class SnapperCmd: if pre_number is not None: self.cmd.append(f"--pre-number {pre_number}") else: - logging.warning("snapshot type specified as 'post' but no pre snapshot number passed.") - logging.warning("setting snapshot type to 'single'.") + logging.debug("snapshot type specified as 'post' but no pre snapshot number, " + "so setting snapshot type to 'single'. If installing " + "snap-pac this is normal.") snapshot_type = "single" self.cmd.append(f"--type {snapshot_type}") @@ -151,7 +152,8 @@ class Prefile: pre_number = self.file.read_text() except FileNotFoundError: pre_number = None - logging.warning(f"prefile {self.file} not found. Ensure you have run the pre snapshot first.") + logging.debug(f"prefile {self.file} not found. Ensure you have run the pre snapshot first. " + "If installing snap-pac this is normal.") else: self.file.unlink() return pre_number