kuzushi 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/kuzushi.rb +6 -11
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.16
|
data/lib/kuzushi.rb
CHANGED
@@ -111,7 +111,6 @@ class Kuzushi
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def process_volumes(v)
|
114
|
-
handle_tmpfs v if v.media == "tmpfs"
|
115
114
|
handle_ebs v if v.media == "ebs"
|
116
115
|
handle_raid v if v.media == "raid"
|
117
116
|
set_readahead v if v.readahead
|
@@ -149,16 +148,11 @@ class Kuzushi
|
|
149
148
|
o.join(",")
|
150
149
|
end
|
151
150
|
|
152
|
-
def handle_tmpfs(m)
|
153
|
-
m.format ||= "tmpfs"
|
154
|
-
m.device ||= "tmpfs"
|
155
|
-
end
|
156
|
-
|
157
151
|
def handle_mount(m)
|
158
152
|
task "mount #{m.mount}" do
|
159
153
|
unless mounted?(m.mount)
|
160
154
|
shell "mv #{m.mount} #{m.mout}.old" if File.exists?(m.mount)
|
161
|
-
shell "mkdir -p #{m.mount} && mount -o #{mount_options(m)} -t #{m.format} #{m.device} #{m.mount}"
|
155
|
+
shell "mkdir -p #{m.mount} && mount -o #{mount_options(m)} -t #{m.format || m.media} #{m.device || m.media} #{m.mount}"
|
162
156
|
shell "chown -R #{m.user}:#{m.group} #{m.mount}" if m.user or m.group
|
163
157
|
end
|
164
158
|
end
|
@@ -183,7 +177,7 @@ class Kuzushi
|
|
183
177
|
write_file("/templates/#{f.template}", f.file) do |file|
|
184
178
|
@system = system
|
185
179
|
t = ERB.new File.read(file), 0, '<>'
|
186
|
-
t.result(binding)
|
180
|
+
t.result(binding)
|
187
181
|
end
|
188
182
|
else
|
189
183
|
src = f.source || File.basename(f.file)
|
@@ -196,7 +190,7 @@ class Kuzushi
|
|
196
190
|
def write_file(src, dest, &blk)
|
197
191
|
fetch(src) do |file|
|
198
192
|
FileUtils.mkdir_p(File.dirname(dest))
|
199
|
-
File.open(
|
193
|
+
File.open(dest,"w") { |f| f.write(blk.call(file)) }
|
200
194
|
end
|
201
195
|
end
|
202
196
|
|
@@ -221,9 +215,10 @@ class Kuzushi
|
|
221
215
|
end
|
222
216
|
|
223
217
|
def handle_format(v)
|
218
|
+
return if v.format == "tmpfs"
|
224
219
|
task "formatting #{v.device}", :init => true do
|
225
220
|
label = "-L " + v.label rescue ""
|
226
|
-
shell "mkfs.#{v.format} #{label} #{v.device}"
|
221
|
+
shell "mkfs.#{v.format} #{label} #{v.device}" unless v.mount && mounted?(v.mount)
|
227
222
|
end
|
228
223
|
add_package "xfsprogs" if v.format == "xfs"
|
229
224
|
end
|
@@ -307,7 +302,7 @@ class Kuzushi
|
|
307
302
|
|
308
303
|
def shell(cmd)
|
309
304
|
puts "# #{cmd}"
|
310
|
-
puts
|
305
|
+
puts Kernel.system cmd ## FIXME - need to handle/report exceptions here
|
311
306
|
end
|
312
307
|
|
313
308
|
def init?
|