Merge lp:~jacekn/charm-helpers/charm-helpers-bugfix into lp:charm-helpers

Proposed by Jacek Nykis
Status: Merged
Merged at revision: 74
Proposed branch: lp:~jacekn/charm-helpers/charm-helpers-bugfix
Merge into: lp:charm-helpers
Diff against target: 21 lines (+6/-1)
1 file modified
charmhelpers/fetch/bzrurl.py (+6/-1)
To merge this branch: bzr merge lp:~jacekn/charm-helpers/charm-helpers-bugfix
Reviewer Review Type Date Requested Status
Matthew Wedgwood (community) Approve
Review via email: mp+181514@code.launchpad.net

Description of the change

Fixed small bug. This way if bzrlib is not available BzrFetchUrlHandler will try to install it

To post a comment you must log in.
Revision history for this message
Matthew Wedgwood (mew) wrote :

Yep, looks like the right thing to do.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/fetch/bzrurl.py'
2--- charmhelpers/fetch/bzrurl.py 2013-08-21 11:45:37 +0000
3+++ charmhelpers/fetch/bzrurl.py 2013-08-22 10:21:29 +0000
4@@ -1,11 +1,16 @@
5 import os
6-from bzrlib.branch import Branch
7 from charmhelpers.fetch import (
8 BaseFetchHandler,
9 UnhandledSource
10 )
11 from charmhelpers.core.host import mkdir
12
13+try:
14+ from bzrlib.branch import Branch
15+except ImportError:
16+ from charmhelpers.fetch import apt_install
17+ apt_install("python-bzrlib")
18+ from bzrlib.branch import Branch
19
20 class BzrUrlFetchHandler(BaseFetchHandler):
21 """Handler for bazaar branches via generic and lp URLs"""

Subscribers

People subscribed via source and target branches