Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[zerigo|dns] Fixed the parser. TTL and priority values can be nil and…

… should not be coerced into integers in that case.
  • Loading branch information...
commit f5cb2ad8c2bc5cd1e5f0f76b3311ce707bf9a3b9 1 parent caf949a
@nirvdrum nirvdrum authored
View
4 lib/fog/zerigo/parsers/dns/create_host.rb
@@ -11,8 +11,10 @@ def reset
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
View
4 lib/fog/zerigo/parsers/dns/find_hosts.rb
@@ -12,8 +12,10 @@ def reset
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'
View
4 lib/fog/zerigo/parsers/dns/get_host.rb
@@ -11,8 +11,10 @@ def reset
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
View
4 lib/fog/zerigo/parsers/dns/get_zone.rb
@@ -25,8 +25,10 @@ def end_element(name)
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'
View
4 lib/fog/zerigo/parsers/dns/list_hosts.rb
@@ -12,8 +12,10 @@ def reset
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'
Please sign in to comment.
Something went wrong with that request. Please try again.