Issue #1465 has been updated by incase.

Adding on to this, I think one possible fix is to make provider/package/rpm.rb 
"query" return nil if output is empty (as is already done if the rpm command 
fails for any reason).

More importantly, I really think this bug should be priority "high", since it 
cripples puppet in a very bad and unexpected way. Installing package.arch using 
yum directly works perfectly fine (i.e. installs the package) while puppet 
fails badly (i.e. installs no package when requested to ensure it is installed, 
yet doesn't provide any error).

I found a commandline which could emulate the query as done by rpm.rb in the 
query function. Namely:

<pre> yum -q list installed | grep PACKAGENAME | ( FOUND=0; while read a b c; 
do export FOUND=1; PCK=`echo $a | sed -e 's/\.[^.]*//'`; ARC=`echo $a | sed -e 
's/.*\.\([^.]*\)/\1/'`; if echo $b | grep -q ":"; then EPOCH=`echo $b| cut -d : 
-f 1`; VER=`echo $b | cut -d : -f 2-`; else EPOCH=0; VER="$b" ; fi; REL=`echo 
$VER | sed -e 's/\(.*\)-\([^-]*\)/\2/'`; VER=`echo $VER | sed -e 
's/\(.*\)-\([^-]*\)/\1/'`; echo $PCK $EPOCH $VER $REL $ARC; done ; test $FOUND 
== 1 )</pre>

Of course, this is a really ugly hack around the issue. Fixing the rpm provider 
would be better by far.

My real suggestion so far is that

==== cut ====

if output.empty?
    return nil
end
@property_hash.update(self.class.nevra_to_hash(output))
return @property_hash.dup

==== cut ====

is used in "query" instead of the last two lines alone.

Finally, the rpm provider (and probably the yum provider) need some serious 
rework to support multi-arch (where the rpm query for a package can actually 
return multiple lines, see the FIXME notes in the source), but the above would 
at least make the package installation work again as far as I can tell.

Regards,
Sven
----------------------------------------
Bug #1465: Puppet mistakenly thinks openssl-devel.x86_64 is installed.
http://projects.reductivelabs.com/issues/show/1465

Author: garthrk
Status: Needs more information
Priority: Normal
Assigned to: community
Category: Red Hat
Target version: unplanned
Complexity: Unknown
Patch: None
Affected version: 0.24.7
Keywords: yum package


I'm requiring @openssl-devel.$architecture@, which resolves to 
@openssl-devel.x86...@. Puppet isn't installing it, so my application build is 
failing. 

@puppetd --test --debug@ shows it running @/bin/rpm -q openssl-devel.x86...@. 

<pre>
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q \
openssldevel.x86_64 --nosignature --nodigest --qf %{NAME} \
%|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
</pre>

(I've wrapped it, indicating line splits with @\@)

Pupppet doesn't go on to install anything new. Poking around a little, I see 
@rpm -q openssl-devel.x86_64@ return without error despite 
@openssl-devel.x86_64@ not appearing in the output of @yum list installed@: 

<pre>
# /bin/rpm -q openssl-devel.i386
openssl-devel-0.9.8b-10.el5
# echo $?
0

# /bin/rpm -q  openssl-devel-0.9.8b-10.el5
openssl-devel-0.9.8b-10.el5
# echo $?
0

# /bin/rpm -q openssl-devel.x86_64
# echo $?
0

# /bin/rpm -q openssl-devel.garbage
package openssl-devel.garbage is not installed
# echo $?
1

# yum list installed | grep openssl
openssl.i686                             0.9.8b-10.el5          installed
openssl.x86_64                           0.9.8b-10.el5          installed
openssl-devel.i386                       0.9.8b-10.el5          installed
</pre>

If I run 'yum install openssl-devel.x86_64",it offers to install it.

<pre>
# yum install openssl-devel.x86_64
Loading "rhnplugin" plugin
rhel-x86_64-server-5      100% |=========================| 1.4 kB    00:00     
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package openssl-devel.x86_64 0:0.9.8b-10.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 openssl-devel           x86_64     0.9.8b-10.el5    rhel-x86_64-server-5  1.8 M

Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 1.8 M
Is this ok [y/N]:
</pre>

I can temporarily work around this by manually installing 
@openssl-devel.x86_64@, of course, but that goes against the whole point of 
Puppet. 

I suspect Puppet could fix this by checking for output from @rpm -q@ as well as 
an exit code of @0...@. Hopefully, that won't break on other systems. 

Other system information:

<pre>
# facter
architecture => x86_64
facterversion => 1.5.0
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => test1
id => root
interfaces => eth0,eth1,sit0
kernel => Linux
kernelrelease => 2.6.18-53.1.4.el5.xs4.0.96.17xen
lsbdistcodename => Tikanga
lsbdistdescription => Red Hat Enterprise Linux Server release 5.2 (Tikanga)
lsbdistid => RedHatEnterpriseServer
lsbdistrelease => 5.2
lsbmajdistrelease => 5
lsbrelease => :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:\
graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
memoryfree => 302.15 MB
memorysize => 512.00 MB
operatingsystem => RedHat
operatingsystemrelease => 5
processor0 => Intel(R) Xeon(R) CPU           E5345  @ 2.33GHz
processorcount => 1
ps => ps -ef
puppetversion => 0.24.5
rubysitedir => /usr/lib/ruby/site_ruby/1.8
rubyversion => 1.8.5
swapfree => 543.95 MB
swapsize => 543.99 MB
</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