mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #380 from dylanegan/volume_to_server
server method for Fog::Compute::AWS::Volume to easily get the server instance.
This commit is contained in:
commit
5d9151fac7
2 changed files with 9 additions and 0 deletions
|
@ -49,6 +49,11 @@ module Fog
|
|||
true
|
||||
end
|
||||
|
||||
def server
|
||||
requires :server_id
|
||||
connection.servers('instance-id' => server_id)
|
||||
end
|
||||
|
||||
def server=(new_server)
|
||||
if new_server
|
||||
attach(new_server)
|
||||
|
|
|
@ -13,6 +13,10 @@ Shindo.tests("Fog::Compute[:aws] | volume", ['aws']) do
|
|||
|
||||
@instance.wait_for { state == 'in-use' }
|
||||
|
||||
tests('#server').succeeds do
|
||||
@instance.server
|
||||
end
|
||||
|
||||
tests('#server = nil').succeeds do
|
||||
@instance.server = nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue