mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
changed status to state for conformity and fixed alias for flavor_id
This commit is contained in:
parent
dcfdf36ba2
commit
2dbf7eff37
6 changed files with 18 additions and 18 deletions
|
@ -38,7 +38,7 @@ docean.servers.each do |server|
|
|||
# remember, servers are droplets
|
||||
server.id
|
||||
server.name
|
||||
server.status
|
||||
server.state
|
||||
server.backups_enabled
|
||||
server.image_id
|
||||
server.flavor_id # server 'size' in DigitalOcean's API parlance
|
||||
|
|
|
@ -10,10 +10,10 @@ module Fog
|
|||
|
||||
identity :id
|
||||
attribute :name
|
||||
attribute :status
|
||||
attribute :state, :aliases => 'status'
|
||||
attribute :image_id
|
||||
attribute :region_id
|
||||
attribute :flavor_id, :aliases => :size_id
|
||||
attribute :flavor_id, :aliases => 'size_id'
|
||||
# Not documented in their API, but
|
||||
# available nevertheless
|
||||
attribute :ip_address
|
||||
|
@ -134,7 +134,7 @@ module Fog
|
|||
#
|
||||
# @return [Boolean]
|
||||
def ready?
|
||||
status == 'active'
|
||||
state == 'active'
|
||||
end
|
||||
|
||||
# DigitalOcean API does not support updating server state
|
||||
|
|
|
@ -21,7 +21,7 @@ Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'com
|
|||
attributes = [
|
||||
:id,
|
||||
:name,
|
||||
:status,
|
||||
:state,
|
||||
:backups_active,
|
||||
:ip_address,
|
||||
:flavor_id,
|
||||
|
@ -37,20 +37,20 @@ Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'com
|
|||
test('#reboot') do
|
||||
pending if Fog.mocking?
|
||||
server.reboot
|
||||
server.wait_for { server.status == 'off' }
|
||||
server.status == 'off'
|
||||
server.wait_for { server.state == 'off' }
|
||||
server.state == 'off'
|
||||
end
|
||||
test('#power_cycle') do
|
||||
pending if Fog.mocking?
|
||||
server.wait_for { server.ready? }
|
||||
server.power_cycle
|
||||
server.wait_for { server.status == 'off' }
|
||||
server.status == 'off'
|
||||
server.wait_for { server.state == 'off' }
|
||||
server.state == 'off'
|
||||
end
|
||||
test('#stop') do
|
||||
server.stop
|
||||
server.wait_for { server.status == 'off' }
|
||||
server.status == 'off'
|
||||
server.wait_for { server.state == 'off' }
|
||||
server.state == 'off'
|
||||
end
|
||||
test('#start') do
|
||||
server.start
|
||||
|
@ -62,8 +62,8 @@ Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'com
|
|||
server.start
|
||||
server.wait_for { server.ready? }
|
||||
server.shutdown
|
||||
server.wait_for { server.status == 'off' }
|
||||
server.status == 'off'
|
||||
server.wait_for { server.state == 'off' }
|
||||
server.state == 'off'
|
||||
end
|
||||
test('#update') do
|
||||
begin
|
||||
|
|
|
@ -9,8 +9,8 @@ Shindo.tests('Fog::Compute[:digitalocean] | power_cycle_server request', ['digit
|
|||
service.power_cycle_server(server.id).status == 200
|
||||
end
|
||||
test('state is off') do
|
||||
server.wait_for { server.status == 'off' }
|
||||
server.status == 'off'
|
||||
server.wait_for { server.state == 'off' }
|
||||
server.state == 'off'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Shindo.tests('Fog::Compute[:digitalocean] | power on/off/shutdown requests',
|
|||
tests('success') do
|
||||
|
||||
test('#power_off_server') do
|
||||
server.wait_for(120) { ready? }
|
||||
server.wait_for(180) { server.ready? }
|
||||
service.power_off_server(server.id).body['status'] == 'OK'
|
||||
end
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ Shindo.tests('Fog::Compute[:digitalocean] | reboot_server request', ['digitaloce
|
|||
service.reboot_server(server.id).status == 200
|
||||
end
|
||||
test('state is off') do
|
||||
server.wait_for { server.status == 'off' }
|
||||
server.status == 'off'
|
||||
server.wait_for { server.state == 'off' }
|
||||
server.state == 'off'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue