kuzushi 0.0.3 → 0.0.6

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.
Files changed (4) hide show
  1. data/Rakefile +1 -0
  2. data/VERSION +1 -1
  3. data/lib/kuzushi.rb +10 -5
  4. metadata +11 -1
data/Rakefile CHANGED
@@ -12,6 +12,7 @@ Jeweler::Tasks.new do |s|
12
12
  s.executables = %w(kuzushi)
13
13
  s.add_dependency "rest-client"
14
14
  s.add_dependency "json"
15
+ s.add_dependency "rush"
15
16
  end
16
17
 
17
18
  Jeweler::RubyforgeTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.6
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'json'
3
3
  require 'restclient'
4
4
  require 'ostruct'
5
+ require 'rush'
5
6
 
6
7
  class Kuzushi
7
8
  def initialize(url)
@@ -98,7 +99,7 @@ class Kuzushi
98
99
 
99
100
  def process_mounts(m)
100
101
  task "mount #{m.label}" do
101
- shell "mount -o #{m.options} -L #{m.label} #{m.label}"
102
+ shell "mkdir -p #{m.label} && mount -o #{m.options} -L #{m.label} #{m.label}"
102
103
  end
103
104
  end
104
105
 
@@ -113,7 +114,7 @@ class Kuzushi
113
114
  def process_users(user)
114
115
  (user.authorized_keys || []).each do |key|
115
116
  task "add authorized_key for user #{user.name}" do
116
- shell "su - #{user.name} -c 'mkdir -p .ssh; echo \"#{key}\" >> .ssh/authorized_keys; chmod -R 600 .ssh'"
117
+ shell "su - #{user.name} -c 'mkdir -p .ssh; echo \"#{key}\" >> .ssh/authorized_keys; chmod -R 0600 .ssh'"
117
118
  end
118
119
  end
119
120
  end
@@ -165,7 +166,7 @@ class Kuzushi
165
166
  file = "#{tmp_dir}/#{File.basename(file)}"
166
167
  File.open(file,"w") do |f|
167
168
  f.write(content)
168
- f.chmod(700)
169
+ f.chmod(0700)
169
170
  end if content
170
171
  block.call(file) if block
171
172
  file
@@ -199,7 +200,10 @@ class Kuzushi
199
200
  end
200
201
 
201
202
  def wait_for_volume(vol)
202
- puts "waiting for volume #{vol}"
203
+ until File.exists?("/sys/block/#{File.basename(vol)}") do
204
+ puts "waiting for volume #{vol}"
205
+ sleep 2
206
+ end
203
207
  end
204
208
 
205
209
  def start
@@ -212,7 +216,8 @@ class Kuzushi
212
216
  end
213
217
 
214
218
  def shell(cmd, env = {})
215
- puts " SHELL: #{cmd}"
219
+ puts "# #{cmd}"
220
+ puts Rush.bash cmd, :env => env
216
221
  end
217
222
 
218
223
  def task(description, &blk)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuzushi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orion Henry
@@ -32,6 +32,16 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: "0"
34
34
  version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rush
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
35
45
  description: A tool used by the sumo gem for performing instance setup and management in AWS
36
46
  email: orion@heroku.com
37
47
  executables: