Merge lp:~seb128/ubuntuone-client-data/hook-import-error into lp:ubuntuone-client-data

Proposed by Sebastien Bacher
Status: Merged
Approved by: dobey
Approved revision: no longer in the source branch.
Merged at revision: 14
Proposed branch: lp:~seb128/ubuntuone-client-data/hook-import-error
Merge into: lp:ubuntuone-client-data
Diff against target: 12 lines (+1/-1)
1 file modified
apport/source_ubuntuone-client-data.py (+1/-1)
To merge this branch: bzr merge lp:~seb128/ubuntuone-client-data/hook-import-error
Reviewer Review Type Date Requested Status
dobey (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+273407@code.launchpad.net

Commit message

Use correct apport hook syntax to avoid import error

Description of the change

Use correct apport hook syntax to avoid import error

current version errors out

  File "/usr/share/apport/package-hooks/source_ubuntuone-client-data.py", line 18, in <module>
    from apport.packaging import is_distro_package
ImportError: cannot import name 'is_distro_package'

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
dobey (dobey) wrote :

Why this change?

review: Needs Information
Revision history for this message
dobey (dobey) wrote :

Where did is_distro_package go, rather? If it's not there, won't the hook still fail, since it's depending on that function?

Revision history for this message
Sebastien Bacher (seb128) wrote :

> Why this change?

Because of the error described in the "description"

> Where did is_distro_package go, rather? If it's not there, won't the hook still fail, since it's depending on that function?

I don't understand the python details enough to reply, apport.packaging.is_distro_package is an "instancemethod" and not a "function" according to type(), anyway "ubuntu-bug ubuntu-client-data" triggers currently an ImportError and works with the suggested change

Revision history for this message
dobey (dobey) wrote :

Seems apport broke API at some point without warning, and after looking at the apport code, it seems like this would work with new apport, but not older ones where this isn't broken.

review: Approve
13. By Sebastien Bacher

Use correct apport hook syntax to avoid import error

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apport/source_ubuntuone-client-data.py'
2--- apport/source_ubuntuone-client-data.py 2012-09-05 21:15:26 +0000
3+++ apport/source_ubuntuone-client-data.py 2015-10-07 07:18:17 +0000
4@@ -15,7 +15,7 @@
5 # with this program. If not, see <http://www.gnu.org/licenses/>.
6 """Stub for Apport"""
7
8-from apport.packaging import is_distro_package
9+import apport.packaging
10
11
12 def add_info(report):

Subscribers

People subscribed via source and target branches