mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|auto_scale] fixed bug with group_config.update; added save and reload method
This commit is contained in:
parent
33214bbc4d
commit
e6dd59c409
1 changed files with 21 additions and 2 deletions
|
@ -49,11 +49,30 @@ module Fog
|
|||
options['maxEntities'] = max_entities
|
||||
options['metadata'] = metadata unless metadata.nil?
|
||||
|
||||
data = service.update_group_config(group.id, options)
|
||||
merge_attributes(data.body)
|
||||
service.update_group_config(group.id, options)
|
||||
true
|
||||
end
|
||||
|
||||
# Saves group's configuration.
|
||||
# This method will only save existing group configurations. New group configurations are created when a scaling group is created
|
||||
# @return [Boolean] true if server has started saving
|
||||
def save
|
||||
if group.id
|
||||
update
|
||||
true
|
||||
else
|
||||
raise "New #{self.class} are created when a new Fog::Rackspace::AutoScale::Group is created"
|
||||
end
|
||||
end
|
||||
|
||||
def reload
|
||||
if group.id
|
||||
data = service.get_group_config(group.id)
|
||||
merge_attributes data.body['groupConfiguration']
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue