Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Use Fog::Formatador
Browse files Browse the repository at this point in the history
  • Loading branch information
starbelly committed Jan 17, 2015
1 parent 8adec4d commit 7eb6b05
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/fog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/bin/clodo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def [](service)
@@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}"
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/vcloud_director/models/compute/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def success?
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
Expand Down
6 changes: 3 additions & 3 deletions tests/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ def array_differences(array_a, array_b)
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

# mark libvirt tests pending if not setup
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

0 comments on commit 7eb6b05

Please sign in to comment.