mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Use Fog::Formatador
This commit is contained in:
parent
8adec4d448
commit
7eb6b05bea
5 changed files with 10 additions and 10 deletions
4
Rakefile
4
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
|
||||
|
|
4
bin/fog
4
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
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue