Chef

user provider doesn't handle 'shadow' not being installed correctly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.5.1, 0.5.2
  • Fix Version/s: 0.5.4
  • Component/s: None
  • Labels:
    None

Description

Because LoadError isn't an Exception, the code block for handling it never catches it.

>> LoadError.is_a?Exception
=> false

if @new_resource.password
begin
require 'shadow'
rescue Exception => e
Chef::Log.error("You must have ruby-shadow installed for password support!")
raise Chef::Exception::MissingLibrary, "You must have ruby-shadow installed for password support!"
end
shadow_info = Shadow::Passwd.getspnam(@new_resource.username)
@current_resource.password(shadow_info.sp_pwdp)
end

should be rescue LoadError

Activity

Hide
AJ Christensen added a comment - 10/Feb/09 1:04 AM
Show
AJ Christensen added a comment - 10/Feb/09 1:04 AM Pull req sent, fix at http://github.com/fujin/chef/tree/chef-82
Hide
Adam Jacob added a comment - 11/Feb/09 12:25 AM

This is integrated - thanks, AJ.

Show
Adam Jacob added a comment - 11/Feb/09 12:25 AM This is integrated - thanks, AJ.

People

Vote (0)
Watch (0)

Dates

  • Created:
    03/Feb/09 12:58 AM
    Updated:
    11/Feb/09 12:25 AM
    Resolved:
    10/Feb/09 1:04 AM