mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|glesys] consistency/cleanup
This commit is contained in:
parent
e6f09326e9
commit
d5ba0489ea
4 changed files with 21 additions and 26 deletions
|
@ -5,8 +5,6 @@ class Glesys < Fog::Bin
|
|||
case key
|
||||
when :compute
|
||||
Fog::Compute::Glesys
|
||||
when :storage
|
||||
Fog::Storage::Glesys
|
||||
else
|
||||
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
||||
end
|
||||
|
@ -16,11 +14,8 @@ class Glesys < Fog::Bin
|
|||
@@connections ||= Hash.new do |hash, key|
|
||||
hash[key] = case key
|
||||
when :compute
|
||||
Formatador.display_line("[yellow][WARN] Glesys[:compute] is deprecated, use Compute[:Glesys] instead[/]")
|
||||
Formatador.display_line("[yellow][WARN] Glesys[:compute] is deprecated, use Compute[:glesys] instead[/]")
|
||||
Fog::Compute.new(:provider => 'Glesys')
|
||||
when :storage
|
||||
Formatador.display_line("[yellow][WARN] Glesys[:storage] is deprecated, use Storage[:Glesys] instead[/]")
|
||||
Fog::Storage.new(:provider => 'Glesys')
|
||||
else
|
||||
raise ArgumentError, "Unrecognized service: #{service}"
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Shindo.tests('Fog::Compute[:Glesys] | ip requests', ['glesys']) do
|
||||
Shindo.tests('Fog::Compute[:glesys] | ip requests', ['glesys']) do
|
||||
|
||||
@free_ip = nil
|
||||
@ips = nil
|
||||
|
@ -7,13 +7,13 @@ Shindo.tests('Fog::Compute[:Glesys] | ip requests', ['glesys']) do
|
|||
|
||||
tests("#ip_list_own()").formats(Glesys::Compute::Formats::Ips::IPLIST) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].ip_list_own.body['response']
|
||||
Fog::Compute[:glesys].ip_list_own.body['response']
|
||||
end
|
||||
|
||||
tests("#ip_list_free(:datcenter => 'Falkenberg, :platform => 'Xen', :ipversion => 4)"
|
||||
).formats(Glesys::Compute::Formats::Ips::IPLIST_ALL) do
|
||||
pending if Fog.mocking?
|
||||
ips = Fog::Compute[:Glesys].ip_list_free(
|
||||
ips = Fog::Compute[:glesys].ip_list_free(
|
||||
:datacenter => "Falkenberg",
|
||||
:platform => "Xen",
|
||||
:ipversion => 4
|
||||
|
@ -25,7 +25,7 @@ Shindo.tests('Fog::Compute[:Glesys] | ip requests', ['glesys']) do
|
|||
tests("#ip_take(:datacenter => 'Falkenberg', :platform => 'Xen', :ipversion => 4, :ipaddress => #{@free_ip})"
|
||||
).formats(Glesys::Compute::Formats::Ips::IPLIST_CATCH_RELEASE) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].ip_take(
|
||||
Fog::Compute[:glesys].ip_take(
|
||||
:datacenter => "Falkenberg",
|
||||
:platform => "Xen",
|
||||
:ipversion => 4,
|
||||
|
@ -36,7 +36,7 @@ Shindo.tests('Fog::Compute[:Glesys] | ip requests', ['glesys']) do
|
|||
tests("#ip_release(:ipaddress => '#{@free_ip}', :ipversion => 4)"
|
||||
).formats(Glesys::Compute::Formats::Ips::IPLIST_CATCH_RELEASE) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].ip_release(
|
||||
Fog::Compute[:glesys].ip_release(
|
||||
:ipaddress => @free_ip,
|
||||
:ipversion => 4
|
||||
).body['response']
|
||||
|
@ -52,7 +52,7 @@ Shindo.tests('Fog::Compute[:Glesys] | ip requests', ['glesys']) do
|
|||
|
||||
tests("#ip_take_argument_error()").raises(Excon::Errors::HTTPStatusError) do
|
||||
pending if Fog.mocking?
|
||||
ip = Fog::Compute[:Glesys].ips.new(
|
||||
ip = Fog::Compute[:glesys].ips.new(
|
||||
:datacenter => "Falkenberg",
|
||||
:platform => "Xen",
|
||||
:version => 4,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Shindo.tests('Fog::Compute[:Glesys] | server requests', ['glesys']) do
|
||||
Shindo.tests('Fog::Compute[:glesys] | server requests', ['glesys']) do
|
||||
|
||||
@serverid = nil
|
||||
@hostname = "fog.#{Time.now.to_i}"
|
||||
|
@ -11,12 +11,12 @@ Shindo.tests('Fog::Compute[:Glesys] | server requests', ['glesys']) do
|
|||
|
||||
tests("#list_servers()").formats(Glesys::Compute::Formats::Servers::LIST) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].list_servers.body['response']
|
||||
Fog::Compute[:glesys].list_servers.body['response']
|
||||
end
|
||||
|
||||
tests("#create(#{@create})").formats(Glesys::Compute::Formats::Servers::CREATE) do
|
||||
pending if Fog.mocking?
|
||||
vm = Fog::Compute[:Glesys].create(
|
||||
vm = Fog::Compute[:glesys].create(
|
||||
:hostname => @hostname,
|
||||
:rootpw => "pw#{Time.now.to_i}",
|
||||
:datacenter => "Falkenberg",
|
||||
|
@ -33,44 +33,44 @@ Shindo.tests('Fog::Compute[:Glesys] | server requests', ['glesys']) do
|
|||
end
|
||||
|
||||
unless Fog.mocking?
|
||||
Fog::Compute[:Glesys].servers.get(@serverid).wait_for { ready? }
|
||||
Fog::Compute[:glesys].servers.get(@serverid).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("#server_details(#{@serverid})").formats(Glesys::Compute::Formats::Servers::DETAILS) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].server_details(@serverid).body['response']
|
||||
Fog::Compute[:glesys].server_details(@serverid).body['response']
|
||||
end
|
||||
|
||||
tests("#server_status(#{@serverid})").formats(Glesys::Compute::Formats::Servers::STATUS) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].server_status(@serverid).body['response']
|
||||
Fog::Compute[:glesys].server_status(@serverid).body['response']
|
||||
end
|
||||
|
||||
tests("#stop(:serverid => #{@serverid})").formats(Glesys::Compute::Formats::Servers::START_STOP) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].stop(:serverid => @serverid).body['response']
|
||||
Fog::Compute[:glesys].stop(:serverid => @serverid).body['response']
|
||||
end
|
||||
|
||||
# Wait for stopped
|
||||
unless Fog.mocking?
|
||||
pending if Fog.mocking?
|
||||
s = Fog::Compute[:Glesys].servers.get(@serverid)
|
||||
s = Fog::Compute[:glesys].servers.get(@serverid)
|
||||
s.wait_for { s.state == 'stopped' }
|
||||
end
|
||||
|
||||
tests("#start(:serverid => #{@serverid})").formats(Glesys::Compute::Formats::Servers::START_STOP) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].start(:serverid => @serverid).body['response']
|
||||
Fog::Compute[:glesys].start(:serverid => @serverid).body['response']
|
||||
end
|
||||
|
||||
# Wait for started
|
||||
unless Fog.mocking?
|
||||
Fog::Compute[:Glesys].servers.get(@serverid).wait_for { ready? }
|
||||
Fog::Compute[:glesys].servers.get(@serverid).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("#destroy(:serverid => #{@serverid})").formats(Glesys::Compute::Formats::Servers::DESTROY) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].destroy(:serverid => @serverid).body['response']
|
||||
Fog::Compute[:glesys].destroy(:serverid => @serverid).body['response']
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -79,7 +79,7 @@ Shindo.tests('Fog::Compute[:Glesys] | server requests', ['glesys']) do
|
|||
|
||||
tests("#create(:hostname => 0)").raises(Excon::Errors::HTTPStatusError) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].create(:hostname => 0)
|
||||
Fog::Compute[:glesys].create(:hostname => 0)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Shindo.tests('Fog::Compute[:Glesys] | template requests', ['glesys']) do
|
||||
Shindo.tests('Fog::Compute[:glesys] | template requests', ['glesys']) do
|
||||
|
||||
tests('success') do
|
||||
|
||||
tests("#template_list()").formats(Glesys::Compute::Formats::Templates::LIST) do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:Glesys].template_list.body['response']
|
||||
Fog::Compute[:glesys].template_list.body['response']
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue