Closed mrichar1 closed 9 years ago
I thought the privilege (operator, administrator) was assigned to the user at user creation time? It seems weird that the CLI/Rubyipmi would be able to override the role that is assigned to the user.
To answer your question about extending support. Yes it would be really simple to add the priv option to the connection object. Basically would need to do the following in the initialize method of the connection object.
If you want to code this yourself and issue a pull request it should be fairly simple to do. Otherwise I can probably take care of this next week.
class Connection
def initialize
...
@options['L'] = opts[:priv] if opts.keys?(:priv)
# should probably check to make sure the priv type matches one of these
#-L <privlvl>
# Force session privilege level. Can be CALLBACK, USER, OPERATOR, ADMINISTRATOR. #Default is ADMINISTRATOR.
end
then call
conn = Rubyipmi.connect("username", "password", "hostname", {:priv => 'OPERATOR'})
@mrichar1 just pushed branch 0.8.0 with this support. https://github.com/logicminds/rubyipmi/tree/0.8.0
I haven't merged to master yet until I can get my integration tests to pass. Feel free to test using this branch.
The privilege is optional as I am seeing weird issues sometimes when using it. Just provide this option to test out.
conn = Rubyipmi.connect("username", "password", "hostname", 'any', {:privilege => 'OPERATOR'})
# PRIV_TYPES = ['CALLBACK', 'USER', 'OPERATOR', 'ADMINISTRATOR']
Hi,
I've done some testing and it seems to work as expected, both with ipmitool and freeipmi.
Many thanks!
this has now been merge to master. Will release to ruby gems shortly.
Both ipmitool and freeipmi assume a default privilege level for the connection (administrator and operator respectively). This will result in an error if the user isn't at this level.
Both toolsets have a flag to pass in a specific priv (-L and -l) - can rubyipmi be extended to support setting the privilege level in the connection object?
Thanks!