1 |
No point in duplicating our own when snakeoil provides a better one. |
2 |
--- |
3 |
catalyst/base/resume.py | 5 +++-- |
4 |
catalyst/base/stagebase.py | 6 ++++-- |
5 |
catalyst/support.py | 8 -------- |
6 |
3 files changed, 7 insertions(+), 12 deletions(-) |
7 |
|
8 |
diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py |
9 |
index e3f03e7..443b46d 100644 |
10 |
--- a/catalyst/base/resume.py |
11 |
+++ b/catalyst/base/resume.py |
12 |
@@ -15,8 +15,9 @@ import os |
13 |
import sys |
14 |
import traceback |
15 |
|
16 |
+from snakeoil import fileutils |
17 |
+ |
18 |
from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir |
19 |
-from catalyst.support import touch |
20 |
|
21 |
|
22 |
class AutoResumeError(Exception): |
23 |
@@ -69,7 +70,7 @@ class AutoResume(object): |
24 |
myf.write(data) |
25 |
else: |
26 |
try: |
27 |
- touch(fname) |
28 |
+ fileutils.touch(fname) |
29 |
self._points[point] = fname |
30 |
except Exception as e: |
31 |
print AutoResumeError(str(e)) |
32 |
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
33 |
index 813e5f1..f81c51b 100644 |
34 |
--- a/catalyst/base/stagebase.py |
35 |
+++ b/catalyst/base/stagebase.py |
36 |
@@ -9,12 +9,14 @@ from stat import ST_UID, ST_GID, ST_MODE |
37 |
# for convienience |
38 |
pjoin = os.path.join |
39 |
|
40 |
+from snakeoil import fileutils |
41 |
+ |
42 |
from DeComp.compress import CompressMap |
43 |
|
44 |
from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, |
45 |
PORT_LOGDIR_CLEAN) |
46 |
from catalyst.support import (CatalystError, msg, file_locate, normpath, |
47 |
- touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, |
48 |
+ cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, |
49 |
file_check) |
50 |
from catalyst.base.targetbase import TargetBase |
51 |
from catalyst.base.clearbase import ClearBase |
52 |
@@ -1513,7 +1515,7 @@ class StageBase(TargetBase, ClearBase, GenBase): |
53 |
cmd(self.settings["controller_file"]+\ |
54 |
" build_packages "+mypack,\ |
55 |
"Error in attempt to build packages",env=self.env) |
56 |
- touch(build_packages_resume) |
57 |
+ fileutils.touch(build_packages_resume) |
58 |
self.resume.enable("build_packages") |
59 |
except CatalystError: |
60 |
self.unbind() |
61 |
diff --git a/catalyst/support.py b/catalyst/support.py |
62 |
index 1207d36..960a91d 100644 |
63 |
--- a/catalyst/support.py |
64 |
+++ b/catalyst/support.py |
65 |
@@ -250,14 +250,6 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec): |
66 |
raise CatalystError('\n\tAlso: '.join(messages)) |
67 |
|
68 |
|
69 |
-def touch(myfile): |
70 |
- try: |
71 |
- myf=open(myfile,"w") |
72 |
- myf.close() |
73 |
- except IOError: |
74 |
- raise CatalystError("Could not touch "+myfile+".", print_traceback=True) |
75 |
- |
76 |
- |
77 |
def countdown(secs=5, doing="Starting"): |
78 |
if secs: |
79 |
print ">>> Waiting",secs,"seconds before starting..." |
80 |
-- |
81 |
2.5.2 |