Clean up InstallBuckets action a bit
This commit is contained in:
parent
0f533a9b30
commit
2f75ffe692
1 changed files with 10 additions and 11 deletions
|
@ -11,28 +11,27 @@ module VagrantPlugins
|
||||||
def call(env)
|
def call(env)
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
||||||
@env = env
|
configure_cache_buckets(env)
|
||||||
configure_cache_buckets
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def configure_cache_buckets
|
def configure_cache_buckets
|
||||||
return unless @env[:machine].config.cache.enabled?
|
return unless env[:machine].config.cache.enabled?
|
||||||
|
|
||||||
if @env[:machine].config.cache.auto_detect
|
if env[:machine].config.cache.auto_detect
|
||||||
Bucket.auto_detect(@env)
|
Bucket.auto_detect(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
return unless @env[:machine].config.cache.buckets.any?
|
return unless env[:machine].config.cache.buckets.any?
|
||||||
|
|
||||||
@env[:ui].info 'Configuring cache buckets...'
|
env[:ui].info 'Configuring cache buckets...'
|
||||||
cache_config = @env[:machine].config.cache
|
cache_config = env[:machine].config.cache
|
||||||
cache_config.buckets.each do |bucket_name, configs|
|
cache_config.buckets.each do |bucket_name, configs|
|
||||||
# cachier_debug "Installing #{bucket_name} with configs #{configs.inspect}"
|
# cachier_debug "Installing #{bucket_name} with configs #{configs.inspect}"
|
||||||
Bucket.install(bucket_name, @env, configs)
|
Bucket.install(bucket_name, env, configs)
|
||||||
end
|
end
|
||||||
|
|
||||||
data_file = @env[:machine].data_dir.join('cache_dirs')
|
data_file = env[:machine].data_dir.join('cache_dirs')
|
||||||
data_file.open('w') { |f| f.print @env[:cache_dirs].uniq.join("\n") }
|
data_file.open('w') { |f| f.print env[:cache_dirs].uniq.join("\n") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue