Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Infoblox::Host put not working anymore #31

Closed
Klaas- opened this issue Jun 18, 2015 · 6 comments
Closed

Infoblox::Host put not working anymore #31

Klaas- opened this issue Jun 18, 2015 · 6 comments

Comments

@Klaas-
Copy link
Contributor

Klaas- commented Jun 18, 2015

Hi :)
I'm going through the process of rechecking everything I need and I discoverd that putting a host object is not working anymore.

at HEAD
irb(main):003:0> Infoblox::VERSION
=> "0.4.0"
irb(main):004:0> connection = Infoblox::Connection.new(:username => 'admin', :password => 'password', :host => 'https://url')
irb(main):005:0> host = Infoblox::Host.find(connection, {"ipv4addr" => "192.168.0.1"}).first
irb(main):006:0> host.configure_for_dns = false
irb(main):007:0> host.put
NoMethodError: undefined method `remote_attribute_hash' for #<Hash:0x00000000ed50d0>
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:46:in `block (2 levels) in remote_attribute_hash'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:45:in `map'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:45:in `block in remote_attribute_hash'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:44:in `tap'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:44:in `remote_attribute_hash'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource.rb:146:in `put'
        from (irb):7
        from /opt/rh/ruby193/root/usr/bin/irb:12:in `<main>'

at 9e7dc1e90e2585ebccf3c44c7911cff76e354f6d
irb(main):003:0> Infoblox::VERSION
=> "0.3.2"
irb(main):004:0> connection = Infoblox::Connection.new(:username => 'admin', :password => 'password', :host => 'https://url')
irb(main):005:0> host = Infoblox::Host.find(connection, {"ipv4addr" => "192.168.0.1"}).first
irb(main):006:0> host.configure_for_dns = false
irb(main):007:0> host.put
Infoblox::Error: Error: 400 { "Error": "AdmConProtoError: Field is not writable: zone",
  "code": "Client.Ibap.Proto",
  "text": "Field is not writable: zone"
}
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:82:in `block in wrap'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:80:in `tap'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:80:in `wrap'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:31:in `put'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource.rb:144:in `put'
        from (irb):7
        from /opt/rh/ruby193/root/usr/bin/irb:12:in `<main>'
irb(main):008:0>

before a6cce7cf8142ac9925b71c6a1a0c7027d7a5b72d
working

Thanks for all your work :)

@unclebilly
Copy link
Contributor

Oh, shame on me. I'll fix that and write a proper integration test to
catch it.

On Thu, Jun 18, 2015 at 10:43 AM Klaas- notifications@github.com wrote:

Hi :)
I'm going through the process of rechecking everything I need and I
discoverd that putting a host object is not working anymore.

at HEAD
irb(main):003:0> Infoblox::VERSION
=> "0.4.0"
irb(main):004:0> connection = Infoblox::Connection.new(:username => 'admin', :password => 'password', :host => 'https://url')
irb(main):005:0> host = Infoblox::Host.find(connection, {"ipv4addr" => "192.168.0.1"}).first
irb(main):006:0> host.configure_for_dns = false
irb(main):007:0> host.put
NoMethodError: undefined method remote_attribute_hash' for #<Hash:0x00000000ed50d0> from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:46:inblock (2 levels) in remote_attribute_hash'
from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:45:in map' from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:45:inblock in remote_attribute_hash'
from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:44:in tap' from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource/host.rb:44:inremote_attribute_hash'
from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource.rb:146:in put' from (irb):7 from /opt/rh/ruby193/root/usr/bin/irb:12:in

'

at 9e7dc1e
irb(main):003:0> Infoblox::VERSION
=> "0.3.2"
irb(main):004:0> connection = Infoblox::Connection.new(:username => 'admin', :password => 'password', :host => 'https://url')
irb(main):005:0> host = Infoblox::Host.find(connection, {"ipv4addr" => "192.168.0.1"}).first
irb(main):006:0> host.configure_for_dns = false
irb(main):007:0> host.put
Infoblox::Error: Error: 400 { "Error": "AdmConProtoError: Field is not writable: zone",
"code": "Client.Ibap.Proto",
"text": "Field is not writable: zone"
}
from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:82:in block in wrap' from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:80:intap'
from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:80:in wrap' from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/connection.rb:31:input'
from /opt/rh/ruby193/root/usr/local/share/gems/gems/infoblox-0.3.1/lib/infoblox/resource.rb:144:in put' from (irb):7 from /opt/rh/ruby193/root/usr/bin/irb:12:in

'
irb(main):008:0>

before a6cce7c
working

Thanks for all your work :)


Reply to this email directly or view it on GitHub
#31.

@Klaas-
Copy link
Contributor Author

Klaas- commented Jun 18, 2015

I got one more, sorry :)

at HEAD until 28ead2aa6cf19581c3208adcdbca91e3ea417e62
irb(main):003:0> Infoblox::VERSION
=> "0.4.0"
irb(main):004:0> connection = Infoblox::Connection.new(:username => 'admin', :password => 'password', :host => 'https://url')
irb(main):005:0> host = Infoblox::Host.find(connection, {"ipv4addr" => "192.168.0.1"}).first
irb(main):006:0> hostip = host.ipv4addrs.select { |ip| ipv4addr = "192.168.0.1" }.first
irb(main):007:0> hostip.configure_for_dhcp = false
NoMethodError: undefined method `configure_for_dhcp=' for #<Hash:0x00000000ed4e00>
        from (irb):7
        from /opt/rh/ruby193/root/usr/bin/irb:12:in `<main>'
at a07f5852b1935fe1ba9f2deb6d7e6efe965770d6
irb(main):003:0> Infoblox::VERSION
=> "0.3.2"
irb(main):004:0> connection = Infoblox::Connection.new(:username => 'admin', :password => 'password', :host => 'https://url')
irb(main):005:0> host = Infoblox::Host.find(connection, {"ipv4addr" => "192.168.0.1"}).first
irb(main):006:0> hostip = host.ipv4addrs.select { |ip| ipv4addr = "192.168.0.1" }.first
irb(main):007:0> hostip.configure_for_dhcp = false
=> false

@unclebilly
Copy link
Contributor

Both instances of undefined method xxx in 0.4 were due to a regression from fixing the bug in 0.3.2. I'll have a fix shortly.

@unclebilly
Copy link
Contributor

I pushed out 0.4.1 with this fix. Let me know how it works for you.

@Klaas-
Copy link
Contributor Author

Klaas- commented Jun 19, 2015

@unclebilly thanks a lot! :)
Now I got it working with ruby 1.8.7, I made a few changes to my smart-proxy provider and made a pr to foreman :)
theforeman/smart-proxy#295

Greetings
Klaas

@unclebilly
Copy link
Contributor

🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants