Project

General

Profile

Actions

Bug #19540

closed

undefined method `find_subnet' for nil:NilClass (NoMethodError) when attempting to retrieve a free ip

Added by Anonymous almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
DHCP plugin
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

After updating to Foreman 1.15 I ran into a number of problems trying to create a new host and get a suggested ip address from infoblox. I'm using 'record_type : host'.

First:

D, [2017-05-12T09:01:22.544141 ] DEBUG -- : undefined method `network' for "172.29.0.0":String (NoMethodError)
/usr/share/gems/gems/smart_proxy_dhcp_infoblox-0.0.5/lib/smart_proxy_dhcp_infoblox/dhcp_infoblox_main.rb:57:in `unused_ip'
/usr/share/foreman-proxy/modules/dhcp/dhcp_api.rb:34:in `block in <class:DhcpApi>'
/usr/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `call'
...

I noticed that the 'unused_ip' method from 'dhcp_common/server.rb' had been updated in 1.15, and after updating the corresponding method in dhcp_infoblox_main.rb I got rid of that error. Then came another error:
D, [2017-05-12T09:57:35.131682 ] DEBUG -- : undefined method `find_subnet' for nil:NilClass (NoMethodError)
/usr/share/foreman-proxy/modules/dhcp_common/server.rb:40:in `get_subnet'
/usr/share/gems/gems/smart_proxy_dhcp_infoblox-0.0.5/lib/smart_proxy_dhcp_infoblox/dhcp_infoblox_main.rb:57:in `unused_ip'
/usr/share/foreman-proxy/modules/dhcp/dhcp_api.rb:34:in `block in <class:DhcpApi>'
...

So I had to create a local function in dhcp_infoblox_main.rb for 'get_subnet' which finally made it work.

Please excuse the brevity/incompleteness of this report, I just wanted to document this before heading home for the weekend. My ruby skills are very limited so I'm not really fitted to submit a PR for this, but hopefully someone can deduce from this report what needs to be done. If any more information is needed I'll be happy to help.

Actions #1

Updated by Anonymous almost 7 years ago

  • Category set to DHCP plugin
Actions #2

Updated by Anonymous almost 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF