mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1077 from bradgignac/set_server_password
[rackspace|compute] Set password attribute on V2 servers.
This commit is contained in:
commit
ad358b9ddb
2 changed files with 10 additions and 0 deletions
|
@ -41,6 +41,8 @@ module Fog
|
||||||
attribute :flavor_id, :aliases => 'flavor', :squash => 'id'
|
attribute :flavor_id, :aliases => 'flavor', :squash => 'id'
|
||||||
attribute :image_id, :aliases => 'image', :squash => 'id'
|
attribute :image_id, :aliases => 'image', :squash => 'id'
|
||||||
|
|
||||||
|
attr_reader :password
|
||||||
|
|
||||||
def save
|
def save
|
||||||
if identity
|
if identity
|
||||||
update
|
update
|
||||||
|
@ -121,8 +123,15 @@ module Fog
|
||||||
requires :identity
|
requires :identity
|
||||||
connection.change_server_password(identity, password)
|
connection.change_server_password(identity, password)
|
||||||
self.state = PASSWORD
|
self.state = PASSWORD
|
||||||
|
@password = password
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def adminPass=(new_admin_pass)
|
||||||
|
@password = new_admin_pass
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,6 +54,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
||||||
tests('#change_admin_password').succeeds do
|
tests('#change_admin_password').succeeds do
|
||||||
@instance.change_admin_password('somerandompassword')
|
@instance.change_admin_password('somerandompassword')
|
||||||
returns('PASSWORD') { @instance.state }
|
returns('PASSWORD') { @instance.state }
|
||||||
|
returns('somerandompassword') { @instance.password }
|
||||||
end
|
end
|
||||||
|
|
||||||
@instance.wait_for { ready? }
|
@instance.wait_for { ready? }
|
||||||
|
|
Loading…
Add table
Reference in a new issue