follow-recommends throws an attribute error when passed None

Bug #900404 reported by Marc Tardif on 2011-12-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
germinate (Ubuntu)
Colin Watson

Bug Description

I'm running germinate from trunk, revision 461, and I get the following exception when running the command:

# /tmp/oneiric-server-amd64/germinate/bin/germinate -s ubuntu.oneiric -m -d oneiric -a amd64 -c main,universe --seed-packages server/checkbox-certification-server
Traceback (most recent call last):
  File "/tmp/oneiric-server-amd64/germinate/bin/germinate", line 201, in <module>
  File "/tmp/oneiric-server-amd64/germinate/bin/germinate", line 152, in main
  File "/tmp/oneiric-server-amd64/germinate/bin/../germinate/", line 1034, in reverse_depends
    if (self._follow_recommends() or
  File "/tmp/oneiric-server-amd64/germinate/bin/../germinate/", line 1015, in _follow_recommends
    if "follow-recommends" in seed.structure.features:
AttributeError: 'NoneType' object has no attribute 'structure'

The problem seems to be with the following method in the Germinator class:

    def _follow_recommends(self, seed=None):
        """Test whether we should follow Recommends for this seed."""
        if seed is not None:
            if "follow-recommends" in seed._features:
                return True
            if "no-follow-recommends" in seed._features:
                return False
        if "follow-recommends" in seed.structure.features:
            return True
        return False

When passed None, the last conditional statement throws the exception.

Brian Murray (brian-murray) wrote :

I was unable to reproduce this using the packaged version of germinate so I'll move the bug to the germinate project.

affects: germinate (Ubuntu) → germinate
Colin Watson (cjwatson) wrote :

Thanks. Regression introduced in r432, I think.

Changed in germinate:
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
status: New → Triaged
Colin Watson (cjwatson) wrote :

Moving back to the package as (a) germinate 2.0 just reached precise and (b) it's easier for me to track this in Ubuntu (since I can auto-close bugs on upload).

affects: germinate → germinate (Ubuntu)
Colin Watson (cjwatson) wrote :

Fixed in r466.

Changed in germinate (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package germinate - 2.2

germinate (2.2) unstable; urgency=low

  * Fix Germinator._follow_recommends to prevent a crash while calculating
    reverse-dependencies (LP: #900404).

 -- Colin Watson <email address hidden> Wed, 07 Dec 2011 01:48:38 +0000

Changed in germinate (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers