1
0
Fork 0
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:
Kevin Menard 2012-02-10 11:21:34 -05:00
parent caf949af56
commit f5cb2ad8c2
5 changed files with 15 additions and 5 deletions

View file

@ -11,8 +11,10 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'id', 'priority', 'ttl', 'zone-id' when 'id', 'zone-id'
@response[name] = value.to_i @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' when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
@response[name] = value @response[name] = value
end end

View file

@ -12,8 +12,10 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'id', 'priority', 'ttl', 'zone-id' when 'id', 'zone-id'
@host[name] = value.to_i @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' when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
@host[name] = value @host[name] = value
when 'host' when 'host'

View file

@ -11,8 +11,10 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'id', 'priority', 'ttl', 'zone-id' when 'id', 'zone-id'
@response[name] = value.to_i @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' when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
@response[name] = value @response[name] = value
end end

View file

@ -25,8 +25,10 @@ module Fog
if (@in_hosts) if (@in_hosts)
#in hosts part of response #in hosts part of response
case name case name
when 'id', 'priority', 'ttl', 'zone-id' when 'id', 'zone-id'
@host[name] = value.to_i @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' when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
@host[name] = value @host[name] = value
when 'host' when 'host'

View file

@ -12,8 +12,10 @@ module Fog
def end_element(name) def end_element(name)
case name case name
when 'id', 'priority', 'ttl', 'zone-id' when 'id', 'zone-id'
@host[name] = value.to_i @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' when 'data', 'fqdn', 'host-type', 'hostname', 'notes', 'zone-id', 'created-at', 'updated-at'
@host[name] = value @host[name] = value
when 'host' when 'host'