Use our own Vagrant::UI for logging

This commit is contained in:
Justin Campbell 2014-01-24 11:31:55 -05:00
parent 12f7963d1f
commit 1cbdbdc6bf
14 changed files with 19 additions and 15 deletions

View file

@ -14,7 +14,7 @@ module VagrantPlugins
@machine = env[:machine]
if symlinks.any?
env[:ui].info I18n.t('vagrant_cachier.cleanup')
Cachier.ui.info I18n.t('vagrant_cachier.cleanup')
if sshable?
symlinks.each do |symlink|
remove_symlink symlink
@ -43,7 +43,7 @@ module VagrantPlugins
end
end
rescue Timeout::Error
@env[:ui].warn(I18n.t('vagrant_cachier.unable_to_ssh'))
Cachier.ui.warn(I18n.t('vagrant_cachier.unable_to_ssh'))
end
return false

View file

@ -43,7 +43,7 @@ module VagrantPlugins
new_path = new_path.to_s.gsub(/^#{@env[:root_path]}\//, '')
# If we got here there is a single provider specific cacher dir, so
# let's be nice with users and just fix it ;)
@env[:ui].warn I18n.t('vagrant_cachier.will_fix_machine_cache_dir',
Cachier.ui.warn I18n.t('vagrant_cachier.will_fix_machine_cache_dir',
current_path: current_path,
new_path: new_path)
FileUtils.mv current_path, new_path

View file

@ -24,7 +24,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'APT')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'APT')
end
end
end

View file

@ -26,11 +26,11 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.nfs_required', bucket: 'apt-cacher')
Cachier.ui.info I18n.t('vagrant_cachier.nfs_required', bucket: 'apt-cacher')
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'apt-cacher')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'apt-cacher')
end
end
end

View file

@ -24,7 +24,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Chef')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Chef')
end
end
end

View file

@ -25,7 +25,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Composer')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Composer')
end
end
end

View file

@ -29,7 +29,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RubyGems')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RubyGems')
end
end
end

View file

@ -24,7 +24,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'npm')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'npm')
end
end
end

View file

@ -24,7 +24,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Pacman')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Pacman')
end
end
end

View file

@ -29,7 +29,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RVM')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RVM')
end
end
end

View file

@ -27,7 +27,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
end
end
end

View file

@ -27,7 +27,7 @@ module VagrantPlugins
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Zypper')
Cachier.ui.info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Zypper')
end
end
end

View file

@ -8,6 +8,10 @@ I18n.load_path << File.expand_path("../../../locales/en.yml", __FILE__)
module VagrantPlugins
module Cachier
def self.ui
@ui ||= ::Vagrant::UI::Colored.new.scope('Cachier')
end
class Plugin < Vagrant.plugin('2')
name 'vagrant-cachier'

View file

@ -46,7 +46,7 @@ module VagrantPlugins
return unless @env[:machine].config.cache.buckets.any?
@env[:ui].info 'Configuring cache buckets...'
Cachier.ui.info 'Configuring cache buckets...'
cache_config = @env[:machine].config.cache
cache_config.buckets.each do |bucket_name, configs|
cachier_debug "Installing #{bucket_name} with configs #{configs.inspect}"