Issue #2542 has been reported by Al Hoang.

----------------------------------------
Bug #2542: ralsh user broken on fresh 10.5 install
http://projects.reductivelabs.com/issues/2542

Author: Al Hoang
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Complexity: Easy
Affected version: 0.24.8
Keywords: 



When trying to run ralsh user on close to a fresh Leopard 10.5 install (No 
software updates applied yet). The following occurred:

<pre>
$ sudo ralsh user
/Library/Ruby/Site/1.8/puppet/provider/nameservice/directoryservice.rb:276:in 
`get_exec_preamble': undefined method `<<' for nil:NilClass (NoMethodError)
        from 
/Library/Ruby/Site/1.8/puppet/provider/nameservice/directoryservice.rb:137:in 
`list_all_present'
        from 
/Library/Ruby/Site/1.8/puppet/provider/nameservice/directoryservice.rb:230:in 
`single_report'
        from 
/Library/Ruby/Site/1.8/puppet/provider/nameservice/directoryservice.rb:528:in 
`getinfo'
        from /Library/Ruby/Site/1.8/puppet/provider/nameservice.rb:221:in 
`exists?'
        from /Library/Ruby/Site/1.8/puppet/type/user.rb:56:in `retrieve'
        from /Library/Ruby/Site/1.8/puppet/type/user.rb:259:in `retrieve'
        from /Library/Ruby/Site/1.8/puppet/util/autoload.rb:77:in `inject'
        from /Library/Ruby/Site/1.8/puppet/type/user.rb:253:in `each'
        from /Library/Ruby/Site/1.8/puppet/type/user.rb:253:in `inject'
        from /Library/Ruby/Site/1.8/puppet/type/user.rb:253:in `retrieve'
        from /usr/bin/ralsh:232
</pre>

I traced this down to the provider in 
_lib/puppet/provider/directoryservice.rb_.   The regexp inside the method 
_self.get_macosx_version_major_ is the following:

<pre><code class="ruby">
product_version.scan(/(\d+)\.(\d+)./)
</code>
</pre>

It seems this regexp will not be able to handle the case when product_version's 
value is something like 10.5.
 
I am attaching a patch that adds some extra checks in
_self.get_macosx_version_major_ to try the following:

# Find the major version from Facter if the regexp scan fails
# Raise an error if product_version_major has an invalid value


Information from uname -a, sw_vers, and puppet and facter

<pre>
$ puppet --version
0.24.8

$ facter --version
1.5.6

$ uname -a
Darwin medford.local 9.0.0 Darwin Kernel Version 9.0.0: Tue Oct  9 21:37:58 PDT 
2007; root:xnu-1228~1/RELEASE_PPC Power Macintosh

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.5
BuildVersion:   9A581
 
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to