From 7eb6b05beaeda976c6f233fefc5d65f97b4994bc Mon Sep 17 00:00:00 2001 From: starbelly Date: Fri, 16 Jan 2015 18:14:58 -0600 Subject: [PATCH] Use Fog::Formatador --- Rakefile | 4 ++-- bin/fog | 4 ++-- lib/fog/bin/clodo.rb | 2 +- lib/fog/vcloud_director/models/compute/task.rb | 4 ++-- tests/helper.rb | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Rakefile b/Rakefile index 8a76928c4..ee3d27beb 100644 --- a/Rakefile +++ b/Rakefile @@ -102,7 +102,7 @@ task :nuke do begin compute = Fog::Compute.new(:provider => provider) for server in compute.servers - Formatador.display_line("[#{provider}] destroying server #{server.identity}") + Fog::Formatador.display_line("[#{provider}] destroying server #{server.identity}") server.destroy rescue nil end rescue @@ -113,7 +113,7 @@ task :nuke do for record in zone.records record.destroy rescue nil end - Formatador.display_line("[#{provider}] destroying zone #{zone.identity}") + Fog::Formatador.display_line("[#{provider}] destroying zone #{zone.identity}") zone.destroy rescue nil end rescue diff --git a/bin/fog b/bin/fog index 6d49065b2..8b3de855a 100755 --- a/bin/fog +++ b/bin/fog @@ -63,8 +63,8 @@ else @irb.signal_handle end - Formatador.display_line('Welcome to fog interactive!') - Formatador.display_line(":#{Fog.credential} provides #{providers}") + Fog::Formatador.display_line('Welcome to fog interactive!') + Fog::Formatador.display_line(":#{Fog.credential} provides #{providers}") providers = Fog.providers # FIXME: hacks until we can `include Fog` in bin diff --git a/lib/fog/bin/clodo.rb b/lib/fog/bin/clodo.rb index e40794e08..b9381b9d1 100644 --- a/lib/fog/bin/clodo.rb +++ b/lib/fog/bin/clodo.rb @@ -13,7 +13,7 @@ class Clodo < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Clodo[:compute] is deprecated, use Compute[:clodo] instead[/]") + Fog::Formatador.display_line("[yellow][WARN] Clodo[:compute] is deprecated, use Compute[:clodo] instead[/]") Fog::Compute.new(:provider => 'Clodo') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/vcloud_director/models/compute/task.rb b/lib/fog/vcloud_director/models/compute/task.rb index 26d906df5..38c73a72e 100644 --- a/lib/fog/vcloud_director/models/compute/task.rb +++ b/lib/fog/vcloud_director/models/compute/task.rb @@ -36,10 +36,10 @@ module Fog def non_running? if @service.show_progress? && (@last_progress ||= 0) < 100 if status == 'running' - Formatador.redisplay_progressbar(progress, 100, :label => operation_name, :started_at => start_time) + Fog::Formatador.redisplay_progressbar(progress, 100, :label => operation_name, :started_at => start_time) @last_progress = progress elsif status == 'success' - Formatador.redisplay_progressbar(100, 100, :label => operation_name, :started_at => start_time) + Fog::Formatador.redisplay_progressbar(100, 100, :label => operation_name, :started_at => start_time) @last_progress = 100 end end diff --git a/tests/helper.rb b/tests/helper.rb index 22728e6e8..370192a19 100644 --- a/tests/helper.rb +++ b/tests/helper.rb @@ -36,13 +36,13 @@ available_providers = Fog.available_providers.map {|provider| provider.downcase} unavailable_providers = all_providers - available_providers if !ENV['PROVIDER'].nil? && unavailable_providers.include?(ENV['PROVIDER']) - Formatador.display_line("[red]Requested provider #{ENV['PROVIDER']} is not available.[/]" + + Fog::Formatador.display_line("[red]Requested provider #{ENV['PROVIDER']} is not available.[/]" + "[red]Check if .fog file has correct configuration (see '#{Fog.credentials_path}')[/]") exit(0) end for provider in unavailable_providers - Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '#{Fog.credentials_path}' to run them)[/]") + Fog::Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '#{Fog.credentials_path}' to run them)[/]") Thread.current[:tags] << ('-' << provider) end @@ -50,6 +50,6 @@ end begin require('libvirt') rescue LoadError - Formatador.display_line("[yellow]Skipping tests for [bold]libvirt[/] [yellow]due to missing `ruby-libvirt` gem.[/]") + Fog::Formatador.display_line("[yellow]Skipping tests for [bold]libvirt[/] [yellow]due to missing `ruby-libvirt` gem.[/]") Thread.current[:tags] << '-libvirt' end