lib/kuzushi.rb in kuzushi-0.0.9 vs lib/kuzushi.rb in kuzushi-0.0.10
- old
+ new
@@ -108,12 +108,12 @@
shell "gem install #{gem} --no-rdoc --no-ri"
end
end
def process_volumes(v)
- handle_ebs v if v.type == "ebs"
- handle_raid v if v.type == "raid"
+ handle_ebs v if v.media == "ebs"
+ handle_raid v if v.media == "raid"
set_readahead v if v.readahead
set_scheduler v if v.scheduler
handle_format v if v.format
handle_mount v if v.mount
end
@@ -147,11 +147,11 @@
def system_arch
system.kernel["machine"]
end
def mounted?(dev)
- !!system.filesystem[dev]["mount"]
+ !!system.filesystem[File.basename(dev)]["mount"] rescue false
end
def package_arch
`dpkg --print-architecture`.chomp
end
@@ -159,11 +159,11 @@
def process_files(f)
fetch("/templates/#{f.template}") do |file|
task "setting up #{f.file}" do
@system = system
t = ERB.new File.read(file), 0, '<>'
- File.open(f.file,"w") { |f| f.write(t.render) }
+ File.open(f.file,"w") { |f| f.write(t.result) }
end
end
end
def process_users(user)
@@ -187,11 +187,11 @@
end
def handle_format(v)
task "formatting #{v.device}", :init => true do
label = "-L " + v.label rescue ""
- "mkfs.#{v.format} #{label} #{v.device}"
+ shell "mkfs.#{v.format} #{label} #{v.device}"
end
add_package "xfsprogs" if v.format == "xfs"
end
def add_package(p)
@@ -277,10 +277,10 @@
def init?
@init ||= false
end
- def task(description, options = {} &blk)
+ def task(description, options = {}, &blk)
return if options[:init] and not init?
@tasks << { :description => description, :blk => blk }
end
def dev_exists?(dev)