Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 207947

Summary: app-portage/layman-1.1.1 throws an exception that should be trapped but isn't, so crash
Product: Portage Development Reporter: Federico Moro <zayer>
Component: ToolsAssignee: Gunnar Wrobel (RETIRED) <wrobel>
Status: RESOLVED DUPLICATE    
Severity: normal CC: tools-portage
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: action.py.patch

Description Federico Moro 2008-01-28 19:40:21 UTC
Looking for information of an overlay with `layman -i overlay_name`, if overlay doesn't exist, the callings to overlay object methods throws an AttributeError exception so self.rdb.select(i) returns a NoneType object.
Trapping this exception program could inform user that overlay doesn't exist on the current layman db.

Reproducible: Always

Steps to Reproduce:
1. layman -i no_exist_overlay
2.
3.

Actual Results:  
* None
Traceback (most recent call last):
  File "/usr/bin/layman", line 37, in ?
    main()
  File "/usr/bin/layman", line 34, in main
    Actions(Config())
  File "/usr/lib/python2.4/site-packages/layman/action.py", line 473, in __init__
    result += i[1](config).run()
  File "/usr/lib/python2.4/site-packages/layman/action.py", line 296, in run
    if not overlay.is_official():
AttributeError: 'NoneType' object has no attribute 'is_official'

Expected Results:  
* None
* *** This overlay doesn't exist in layman DataBase ***
*
Comment 1 Federico Moro 2008-01-28 19:41:52 UTC
Created attachment 142047 [details, diff]
action.py.patch

Here is a patch for layman's action.py module that trap the exception and inform user that overlay doesn't exist in it's database.
Comment 2 Gunnar Wrobel (RETIRED) gentoo-dev 2008-01-30 07:27:57 UTC
guess I should release a new version soon.

*** This bug has been marked as a duplicate of bug 198483 ***