2012-05-11 07:24 AM
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:
filer = NaServer::new('hen01', 1, 15)
output = filer.invoke("system-get-version")
if(output.results_errno != 0)
puts "Error: " + output.results_reason
puts "DOT version is: " + output.child_get_string("version") + "\n"
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?
2012-05-11 09:56 AM
Can you try removing 'filer.set_admin_user' statement?
In case of "HOSTS" style, username and password need not be set.
Also, ensure that you are root user while executing the script on the client.