Add an importutils function for try_import

Bug #1099501 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Medium
Dan Prince
Grizzly
Fix Released
Medium
Dan Prince

Bug Description

We do a lot of:

try:
    import foo
except...

in our modules.

Lets implement a simple function in our importutils codebase to handle this a bit more cleanly.

Dan Prince (dan-prince)
Changed in oslo:
assignee: nobody → Dan Prince (dan-prince)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/19646

Mark McLoughlin (markmc)
Changed in oslo:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/19646
Committed: http://github.com/openstack/oslo-incubator/commit/33b12d3c18a35f85785227267347f9ac7f7273a4
Submitter: Jenkins
Branch: master

commit 33b12d3c18a35f85785227267347f9ac7f7273a4
Author: Dan Prince <email address hidden>
Date: Mon Jan 14 12:54:43 2013 -0500

    Implement importutils.try_import.

    Adds a new (simple) importutils.try_import function which
    can return a module name or a default (by default this is None).

    This should help clean up some of our

    try:
        import foo
    except...

    blocks in modules.

    This commit also drops the dependency on python-extras which is
    no longer needed.

    Fixes LP Bug #1099501.

    Change-Id: I8591f79983bdad67a50d1aaae6dce8428dfce084

Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.