mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|autoscale] fixing broken tests
This commit is contained in:
parent
6620145a55
commit
2706fd644f
1 changed files with 12 additions and 4 deletions
|
@ -28,7 +28,7 @@ module Fog
|
|||
#
|
||||
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroupConfig_v1.0__tenantId__groups__groupId__config_Configurations.html
|
||||
def group_config
|
||||
if attributes[:group_config].nil?
|
||||
if attributes[:group_config].nil? && persisted?
|
||||
data = service.get_group_config(identity)
|
||||
attributes[:group_config] = load_model('GroupConfig', data.body['groupConfiguration'])
|
||||
end
|
||||
|
@ -59,7 +59,7 @@ module Fog
|
|||
#
|
||||
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getLaunchConfig_v1.0__tenantId__groups__groupId__launch_Configurations.html
|
||||
def launch_config
|
||||
if attributes[:launch_config].nil?
|
||||
if attributes[:launch_config].nil? && persisted?
|
||||
data = service.get_launch_config(identity)
|
||||
attributes[:launch_config] = load_model('LaunchConfig', data.body['launchConfiguration'])
|
||||
end
|
||||
|
@ -85,7 +85,16 @@ module Fog
|
|||
#
|
||||
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getPolicies_v1.0__tenantId__groups__groupId__policies_Policies.html
|
||||
def policies
|
||||
@policies ||= load_model('Policies')
|
||||
return @policies if @policies
|
||||
if persisted?
|
||||
@policies = load_model('Policies')
|
||||
else
|
||||
@policies = Fog::Rackspace::AutoScale::Policies.new(:service => service, :group => self)
|
||||
@policies.clear
|
||||
end
|
||||
@policies
|
||||
# return nil unless persisted?
|
||||
# @policies ||= load_model('Policies')
|
||||
end
|
||||
|
||||
# Creates group
|
||||
|
@ -197,7 +206,6 @@ module Fog
|
|||
if service && attrs
|
||||
model.merge_attributes(attrs)
|
||||
end
|
||||
model.clear if !persisted?
|
||||
model
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue