public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
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	[thread overview]
Message-ID: <1444544952-32408-10-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1444544952-32408-1-git-send-email-vapier@gentoo.org>

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



  parent reply	other threads:[~2015-10-11  6:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11  6:29 [gentoo-catalyst] [PATCH 01/10] stage1: convert to log module Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 02/10] stage2: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 03/10] stage3: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 04/10] stagebase: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 05/10] clearbase: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 06/10] support: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 07/10] livecd_stage: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 08/10] netboot: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 09/10] embedded/grp: " Mike Frysinger
2015-10-11  6:29 ` Mike Frysinger [this message]
2015-10-11 14:16   ` [gentoo-catalyst] [PATCH 10/10] resume: " Anthony G. Basile
2015-10-11 17:38     ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444544952-32408-10-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox