Use Fog::Formatador

This commit is contained in:
starbelly 2015-01-16 18:14:58 -06:00
parent 8adec4d448
commit 7eb6b05bea
5 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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}"

View File

@ -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

View File

@ -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