mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[zerigo|dns] Fixed the parser. TTL and priority values can be nil and should not be coerced into integers in that case.
This commit is contained in:
parent
caf949af56
commit
f5cb2ad8c2
5 changed files with 15 additions and 5 deletions
|
@ -11,8 +11,10 @@ module Fog
|
|||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'id', 'priority', 'ttl', 'zone-id'
|
||||
when 'id', 'zone-id'
|
||||
@response[name] = value.to_i
|
||||
when 'priority', 'ttl'
|
||||
@response[name] = value.to_i if value
|
||||
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
||||
@response[name] = value
|
||||
end
|
||||
|
|
|
@ -12,8 +12,10 @@ module Fog
|
|||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'id', 'priority', 'ttl', 'zone-id'
|
||||
when 'id', 'zone-id'
|
||||
@host[name] = value.to_i
|
||||
when 'priority', 'ttl'
|
||||
@host[name] = value.to_i if value
|
||||
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
||||
@host[name] = value
|
||||
when 'host'
|
||||
|
|
|
@ -11,8 +11,10 @@ module Fog
|
|||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'id', 'priority', 'ttl', 'zone-id'
|
||||
when 'id', 'zone-id'
|
||||
@response[name] = value.to_i
|
||||
when 'priority', 'ttl'
|
||||
@response[name] = value.to_i if value
|
||||
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
||||
@response[name] = value
|
||||
end
|
||||
|
|
|
@ -25,8 +25,10 @@ module Fog
|
|||
if (@in_hosts)
|
||||
#in hosts part of response
|
||||
case name
|
||||
when 'id', 'priority', 'ttl', 'zone-id'
|
||||
when 'id', 'zone-id'
|
||||
@host[name] = value.to_i
|
||||
when 'priority', 'ttl'
|
||||
@host[name] = value.to_i if value
|
||||
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
||||
@host[name] = value
|
||||
when 'host'
|
||||
|
|
|
@ -12,8 +12,10 @@ module Fog
|
|||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'id', 'priority', 'ttl', 'zone-id'
|
||||
when 'id', 'zone-id'
|
||||
@host[name] = value.to_i
|
||||
when 'priority', 'ttl'
|
||||
@host[name] = value.to_i if value
|
||||
when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
|
||||
@host[name] = value
|
||||
when 'host'
|
||||
|
|
Loading…
Reference in a new issue