From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1A93013888F for ; Sun, 11 Oct 2015 06:29:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 23F3C21C023; Sun, 11 Oct 2015 06:29:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 003BA21C014 for ; Sun, 11 Oct 2015 06:29:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 34BCE340676 for ; Sun, 11 Oct 2015 06:29:19 +0000 (UTC) From: Mike Frysinger To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 10/10] resume: convert to log module Date: Sun, 11 Oct 2015 02:29:12 -0400 Message-Id: <1444544952-32408-10-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1444544952-32408-1-git-send-email-vapier@gentoo.org> References: <1444544952-32408-1-git-send-email-vapier@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 05c3870b-6499-4d70-bad1-7c3b92a21381 X-Archives-Hash: 790d374c3c76d49757c186e6e3c0872b The AutoResumeError exception wasn't actually used as an exception -- it was never raised, only printed. Throw it away in place of a plain log message. --- catalyst/base/resume.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py index 443b46d..99d8abc 100644 --- a/catalyst/base/resume.py +++ b/catalyst/base/resume.py @@ -12,27 +12,13 @@ set, unset, is_set, is_unset, enabled, clear_all ''' import os -import sys -import traceback from snakeoil import fileutils +from catalyst import log from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir -class AutoResumeError(Exception): - def __init__(self, message, print_traceback=False): - if message: - if print_traceback: - (_type, value) = sys.exc_info()[:2] - if value!=None: - print - print "Traceback values found. listing..." - print traceback.print_exc(file=sys.stdout) - print "!!! catalyst: AutoResumeError " + message - print - - class AutoResume(object): '''Class for tracking and handling all aspects of the autoresume option and related files. @@ -73,7 +59,7 @@ class AutoResume(object): fileutils.touch(fname) self._points[point] = fname except Exception as e: - print AutoResumeError(str(e)) + log.error('AutoResumeError: %s', e) return False return True @@ -91,7 +77,7 @@ class AutoResume(object): if data and no_lf: data = data.replace('\n', '') except OSError as e: - print AutoResumeError(str(e)) + log.error('AutoResumeError: %s', e) return None return data return None @@ -109,7 +95,7 @@ class AutoResume(object): os.unlink(self._points[point]) self._points.pop(point) except Exception as e: - print AutoResumeError(str(e)) + log.error('AutoResumeError: %s', e) return False return True -- 2.5.2