I am attempting to use the Ruby API library. I don't like the idea of storing passwords in scripts, so I want to use HOSTS authentication (only marginally better, but that's the choice I get). I created a terribly simple script:
require 'NaServer'
filer = NaServer::new('hen01', 1, 15)
filer.set_admin_user('root', '')
filer.set_style "HOSTS"
output = filer.invoke("system-get-version")
if(output.results_errno != 0)
puts "Error: " + output.results_reason
else
puts "DOT version is: " + output.child_get_string("version") + "\n"
end
I can run this script over and over and about 20% of the time I get the server version back and about 80% of the time I get:
User does not have capability to invoke API system-get-version.
(Notice there is an extra space after "User", implying an empty string in the output, implying the username isn't being procured correctly.)
Anyone have similar experience(s) and/or suggestions on how to make this consistently work?