Bug #4799

portage provider incorrectly fails when eix finds no packages

Added by Lance Albertson over 1 year ago. Updated 4 months ago.

Status:Code Insufficient Start date:09/17/2010
Priority:Normal Due date:
Assignee:Adrien Thebo % Done:

0%

Category:Gentoo
Target version:2.7.x
Affected Puppet version:0.25.5 Branch:
Keywords:
Votes: 0

Description

If the portage provider tries to search of a package that does not exist, errors out and fails with the following error:

err: //rrdtool::python/Package[rrdtool-python]: Failed to retrieve current state of resource: Execution of '/usr/bin/eix --nocolor --pure-packages --stable --format <category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] <homepage> <description>
--exact --name rrdtool-python' returned 1: 

Eix will return 1 if it finds no packages by default. You can change the value eix returns by editing /etc/eixrc and add:

NOFOUND_STATUS=0

When you do that and try running it again, you get a more useful error message:

err: //rrdtool::python/Package[rrdtool-python]: Failed to retrieve current state of resource: No package found with the specified name [<unspecified category>/rrdtool-python]

However, this brings in a whole new problem related to issue #3000. The real fix should deal with exit status in a saner manner possibly similar to how the dpkg provider works.


Related issues

related to Puppet - Refactor #3000: Normalize package providers' treatment of absent packages Accepted 01/02/2010

History

Updated by Lance Albertson over 1 year ago

You can see a possible patch from my branch on github: http://github.com/ramereth/puppet/tree/ticket/0.25.x/4799

Updated by James Turnbull over 1 year ago

  • Status changed from Unreviewed to In Topic Branch Pending Review
  • Target version set to 69

Updated by James Turnbull over 1 year ago

  • Status changed from In Topic Branch Pending Review to Code Insufficient

Lance – can you rebase this on 2.6.x which is current HEAD. Thanks!

Updated by Lance Albertson over 1 year ago

Sure: http://github.com/ramereth/puppet/tree/ticket/2.6.x/4799

Updated by Nigel Kersten over 1 year ago

  • Status changed from Code Insufficient to In Topic Branch Pending Review
  • Target version changed from 69 to 2.6.5

Updated by Paul Berry over 1 year ago

  • Status changed from In Topic Branch Pending Review to Code Insufficient

The patch causes query to return {:ensure => :absent} if eix returned 1, but nil if eix returned 0 and there were no packages found.

It looks like it isn’t safe for query to return nil, and it should return {:ensure => :absent} in both cases.

Lance, can you confirm that this makes sense?

Updated by Nigel Kersten over 1 year ago

  • Target version changed from 2.6.5 to 2.6.x

Updated by James Turnbull over 1 year ago

  • Target version changed from 2.6.x to 2.6.6

Updated by James Turnbull about 1 year ago

  • Target version changed from 2.6.6 to 2.6.x

Updated by Adrien Thebo 9 months ago

  • Assignee set to Adrien Thebo

Updated by Michael Stahnke 4 months ago

  • Target version changed from 2.6.x to 2.7.x

2.6.x is closed. Moving to 2.7.x

Also available in: Atom PDF