mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
change to new attribute handling
This commit is contained in:
parent
e9f28f067e
commit
fbb122e56c
4 changed files with 15 additions and 15 deletions
|
@ -25,7 +25,7 @@ module Fog
|
||||||
|
|
||||||
def monitor=(new_monitor = {})
|
def monitor=(new_monitor = {})
|
||||||
if new_monitor.nil? || new_monitor.empty?
|
if new_monitor.nil? || new_monitor.empty?
|
||||||
@monitor = nil
|
attributes[:monitor] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -37,19 +37,19 @@ module Fog
|
||||||
|
|
||||||
def monitor=(new_monitor = {})
|
def monitor=(new_monitor = {})
|
||||||
if new_monitor.nil? || new_monitor.empty?
|
if new_monitor.nil? || new_monitor.empty?
|
||||||
@monitor = nil
|
attributes[:monitor] = nil
|
||||||
elsif new_monitor.is_a?(Hash)
|
elsif new_monitor.is_a?(Hash)
|
||||||
@monitor = {}
|
attributes[:monitor] = {}
|
||||||
@monitor[:type] = new_monitor[:MonitorType] || new_monitor[:type]
|
attributes[:monitor][:type] = new_monitor[:MonitorType] || new_monitor[:type]
|
||||||
@monitor[:url_send_string] = new_monitor[:UrlSendString] || new_monitor[:url_send_string]
|
attributes[:monitor][:url_send_string] = new_monitor[:UrlSendString] || new_monitor[:url_send_string]
|
||||||
@monitor[:http_headers] = new_monitor[:HttpHeader] || new_monitor[:http_headers]
|
attributes[:monitor][:http_headers] = new_monitor[:HttpHeader] || new_monitor[:http_headers]
|
||||||
@monitor[:http_headers] = @monitor[:http_headers].split("\n") unless @monitor[:http_headers].is_a?(Array)
|
attributes[:monitor][:http_headers] = attributes[:monitor][:http_headers].split("\n") unless attributes[:monitor][:http_headers].is_a?(Array)
|
||||||
@monitor[:receive_string] = new_monitor[:ReceiveString] || new_monitor[:receive_string]
|
attributes[:monitor][:receive_string] = new_monitor[:ReceiveString] || new_monitor[:receive_string]
|
||||||
@monitor[:interval] = new_monitor[:Interval] || new_monitor[:interval]
|
attributes[:monitor][:interval] = new_monitor[:Interval] || new_monitor[:interval]
|
||||||
@monitor[:response_timeout] = new_monitor[:ResponseTimeOut] || new_monitor[:response_timeout]
|
attributes[:monitor][:response_timeout] = new_monitor[:ResponseTimeOut] || new_monitor[:response_timeout]
|
||||||
@monitor[:downtime] = new_monitor[:DownTime] || new_monitor[:downtime]
|
attributes[:monitor][:downtime] = new_monitor[:DownTime] || new_monitor[:downtime]
|
||||||
@monitor[:retries] = new_monitor[:Retries] || new_monitor[:retries]
|
attributes[:monitor][:retries] = new_monitor[:Retries] || new_monitor[:retries]
|
||||||
@monitor[:is_enabled] = new_monitor[:IsEnabled] || new_monitor[:is_enabled]
|
attributes[:monitor][:is_enabled] = new_monitor[:IsEnabled] || new_monitor[:is_enabled]
|
||||||
else
|
else
|
||||||
raise RuntimeError.new("monitor needs to either be nil or a Hash")
|
raise RuntimeError.new("monitor needs to either be nil or a Hash")
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Fog
|
||||||
attribute :id, :aliases => :Id, :type => :integer
|
attribute :id, :aliases => :Id, :type => :integer
|
||||||
|
|
||||||
def rnat=(new_rnat)
|
def rnat=(new_rnat)
|
||||||
@rnat = new_rnat
|
attribute[:rnat] = new_rnat
|
||||||
@changed = true
|
@changed = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def name=(new_name)
|
def name=(new_name)
|
||||||
@name = new_name
|
attributes[:name] = new_name
|
||||||
@changed = true
|
@changed = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue