When I try to add a device to Zenoss using Ruby 1.8.6 and XMLRPC, I am the 
lucky recipient of this error:

/usr/lib/ruby/1.8/xmlrpc/parser.rb:467:in `parseMethodResponse': Missing return 
value! (RuntimeError)
        from /usr/lib/ruby/1.8/xmlrpc/client.rb:421:in `call2'
        from ./zenoss.rb:14

and here is the simple script that I'm running:

#!/usr/bin/ruby

require "rubygems"
require "xmlrpc/client"
require "pp"
 @server = XMLRPC::Client.new2("http://admin:[EMAIL 
PROTECTED]:8080/zport/dmd/DeviceLoader")
 @dev = ['deviceName','127.0.0.1','devicePath','/Server/Linux']
out = @server.call2("loadDevice", "127.0.0.1", "/Server/Linux")
pp out 

-----

In my tracking it down, I've figured out that it only complains when the return 
parameters equal 0. I can fix this by commenting out line 467 of 
/usr/lib/ruby/1.8/xmlrpc/parser.rb (ubuntu 7.10)

#  raise "Missing return value!" if parser.params.size == 0

But this would indicate that I *should* get a return value, not just a 
[true,nil] like I get when I comment this out. I do validation checks on the 
device with this script:

[EMAIL PROTECTED]:~# ./2zenoss.rb 
[true, "ubuntu"]
[EMAIL PROTECTED]:~# cat 2zenoss.rb 
#!/usr/bin/ruby
require "rubygems"
require "xmlrpc/client"
require "pp"
 [EMAIL PROTECTED] = XMLRPC::Client.new2("http://admin:[EMAIL 
PROTECTED]:8080/zport/dmd/DeviceLoader")
 @server = XMLRPC::Client.new2("http://admin:[EMAIL 
PROTECTED]:8080/zport/dmd/Devices/Server/Linux/devices/ubuntu")
 @dev = ['deviceName','127.0.0.1','devicePath','/Server/Linux']
#out = @server.call2("loadDevice", "127.0.0.1", "/Server/Linux")
out = @server.call2("getId")
pp out 


---

Things look ok, but I need to figure out how to get rid of the error on insert.




-------------------- m2f --------------------

Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=14514#14514

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to