Commit e747cd296023f0bef770dbf9d68c09ab9c048229

Authored by Georg Hopp
1 parent c2d4fb24

allow prefix before info messages

@@ -14,7 +14,7 @@ module VagrantPlugins @@ -14,7 +14,7 @@ module VagrantPlugins
14 bs_data = env[:machine].box.metadata["bootstrap"] 14 bs_data = env[:machine].box.metadata["bootstrap"]
15 15
16 bs_data.each do |name, actions| 16 bs_data.each do |name, actions|
17 - env[:ui].info "--- Bootstrap #{name} ---", :prefix => false 17 + env[:ui].info "--- Bootstrap #{name} ---"
18 actions.each do |action, data| 18 actions.each do |action, data|
19 # right now I do not handle differnet actions just return if 19 # right now I do not handle differnet actions just return if
20 # action is not "exec". 20 # action is not "exec".
@@ -24,8 +24,7 @@ module VagrantPlugins @@ -24,8 +24,7 @@ module VagrantPlugins
24 hostname = env[:machine].name 24 hostname = env[:machine].name
25 data.each do |d| 25 data.each do |d|
26 d.collect! { |element| ERB.new(element).result(binding) } 26 d.collect! { |element| ERB.new(element).result(binding) }
27 - env[:ui].info "--- #{action}: #{d.inspect} ---",  
28 - :prefix => false 27 + env[:ui].info "--- #{action}: #{d.inspect} ---"
29 driver.exec(*d, :retryable => true) 28 driver.exec(*d, :retryable => true)
30 end 29 end
31 end 30 end
@@ -9,13 +9,14 @@ module VagrantPlugins @@ -9,13 +9,14 @@ module VagrantPlugins
9 9
10 def call(env) 10 def call(env)
11 driver = env[:machine].provider.driver 11 driver = env[:machine].provider.driver
  12 + config = []
12 13
13 if driver.container? 14 if driver.container?
14 - env[:ui].info "--- Container fount ---", :prefix => false 15 + env[:ui].info "--- Container fount ---"
15 else 16 else
16 - env[:ui].info "--- Create #{driver.name} ---", :prefix => false  
17 - driver.create  
18 - env[:ui].info "--- #{driver.name} created ---", :prefix => false 17 + env[:ui].info "--- Create #{driver.name} ---"
  18 + driver.create env[:machine].provider_config
  19 + env[:ui].info "--- #{driver.name} created ---"
19 end 20 end
20 21
21 # TODO maybe not optimal, check if it would be better to include the 22 # TODO maybe not optimal, check if it would be better to include the
@@ -11,15 +11,13 @@ module VagrantPlugins @@ -11,15 +11,13 @@ module VagrantPlugins
11 box = env[:machine].box 11 box = env[:machine].box
12 driver = env[:machine].provider.driver 12 driver = env[:machine].provider.driver
13 13
14 - env[:ui].info "--- check image for #{env[:machine].name} ---",  
15 - :prefix => false 14 + env[:ui].info "--- check image for #{env[:machine].name} ---"
16 if driver.image? 15 if driver.image?
17 - env[:ui].info "--- Image found ---", :prefix => false 16 + env[:ui].info "--- Image found ---"
18 else 17 else
19 - env[:ui].info "--- Image NOT found (downloading) ---",  
20 - :prefix => false 18 + env[:ui].info "--- Image NOT found (downloading) ---"
21 driver.get_image("images") 19 driver.get_image("images")
22 - env[:ui].info "--- Image download done ---", :prefix => false 20 + env[:ui].info "--- Image download done ---"
23 # TODO maybe we need to check again if the image really exists 21 # TODO maybe we need to check again if the image really exists
24 # now. 22 # now.
25 end 23 end
@@ -11,14 +11,11 @@ module VagrantPlugins @@ -11,14 +11,11 @@ module VagrantPlugins
11 driver = env[:machine].provider.driver 11 driver = env[:machine].provider.driver
12 12
13 if driver.state != :running 13 if driver.state != :running
14 - env[:ui].info "--- start #{driver.name} ---",  
15 - :prefix => false 14 + env[:ui].info "--- start #{driver.name} ---"
16 driver.start 15 driver.start
17 - env[:ui].info "--- #{driver.name} started ---",  
18 - :prefix => false 16 + env[:ui].info "--- #{driver.name} started ---"
19 else 17 else
20 - env[:ui].info "--- #{driver.name} alreay running ---",  
21 - :prefix => false 18 + env[:ui].info "--- #{driver.name} alreay running ---"
22 end 19 end
23 20
24 @app.call(env) 21 @app.call(env)
@@ -6,10 +6,10 @@ module VagrantPlugins @@ -6,10 +6,10 @@ module VagrantPlugins
6 # end 6 # end
7 7
8 def execute 8 def execute
9 - @env.ui.info("my own plugin", :prefix => false)  
10 - @env.ui.info("--- #{@env.inspect} ---", :prefix => false)  
11 - @env.ui.info("--- #{@local_data_path} ---", :prefix => false)  
12 - @env.ui.info("--- #{@env.active_machines} ---", :prefix => false) 9 + @env.ui.info "my own plugin"
  10 + @env.ui.info "--- #{@env.inspect} ---"
  11 + @env.ui.info "--- #{@local_data_path} ---"
  12 + @env.ui.info "--- #{@env.active_machines} ---"
13 end 13 end
14 end 14 end
15 end 15 end
Please register or login to post a comment