1 |
The AutoResumeError exception wasn't actually used as an exception -- |
2 |
it was never raised, only printed. Throw it away in place of a plain |
3 |
log message. |
4 |
--- |
5 |
catalyst/base/resume.py | 22 ++++------------------ |
6 |
1 file changed, 4 insertions(+), 18 deletions(-) |
7 |
|
8 |
diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py |
9 |
index 443b46d..99d8abc 100644 |
10 |
--- a/catalyst/base/resume.py |
11 |
+++ b/catalyst/base/resume.py |
12 |
@@ -12,27 +12,13 @@ set, unset, is_set, is_unset, enabled, clear_all |
13 |
''' |
14 |
|
15 |
import os |
16 |
-import sys |
17 |
-import traceback |
18 |
|
19 |
from snakeoil import fileutils |
20 |
|
21 |
+from catalyst import log |
22 |
from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir |
23 |
|
24 |
|
25 |
-class AutoResumeError(Exception): |
26 |
- def __init__(self, message, print_traceback=False): |
27 |
- if message: |
28 |
- if print_traceback: |
29 |
- (_type, value) = sys.exc_info()[:2] |
30 |
- if value!=None: |
31 |
- print |
32 |
- print "Traceback values found. listing..." |
33 |
- print traceback.print_exc(file=sys.stdout) |
34 |
- print "!!! catalyst: AutoResumeError " + message |
35 |
- print |
36 |
- |
37 |
- |
38 |
class AutoResume(object): |
39 |
'''Class for tracking and handling all aspects of |
40 |
the autoresume option and related files. |
41 |
@@ -73,7 +59,7 @@ class AutoResume(object): |
42 |
fileutils.touch(fname) |
43 |
self._points[point] = fname |
44 |
except Exception as e: |
45 |
- print AutoResumeError(str(e)) |
46 |
+ log.error('AutoResumeError: %s', e) |
47 |
return False |
48 |
return True |
49 |
|
50 |
@@ -91,7 +77,7 @@ class AutoResume(object): |
51 |
if data and no_lf: |
52 |
data = data.replace('\n', '') |
53 |
except OSError as e: |
54 |
- print AutoResumeError(str(e)) |
55 |
+ log.error('AutoResumeError: %s', e) |
56 |
return None |
57 |
return data |
58 |
return None |
59 |
@@ -109,7 +95,7 @@ class AutoResume(object): |
60 |
os.unlink(self._points[point]) |
61 |
self._points.pop(point) |
62 |
except Exception as e: |
63 |
- print AutoResumeError(str(e)) |
64 |
+ log.error('AutoResumeError: %s', e) |
65 |
return False |
66 |
return True |
67 |
|
68 |
-- |
69 |
2.5.2 |