Merge lp:~james-page/charm-helpers/handle-called-process-exception-for-git into lp:charm-helpers

Proposed by James Page
Status: Merged
Merged at revision: 522
Proposed branch: lp:~james-page/charm-helpers/handle-called-process-exception-for-git
Merge into: lp:charm-helpers
Diff against target: 21 lines (+3/-1)
1 file modified
charmhelpers/fetch/giturl.py (+3/-1)
To merge this branch: bzr merge lp:~james-page/charm-helpers/handle-called-process-exception-for-git
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+283583@code.launchpad.net

Description of the change

Prior to the switch to executing git commands directly, any git errors where handled as UnhandledSource exceptions.

Restore this functionality to ensure that all handlers are tried for a given URL, even if its not a git repo.

To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/fetch/giturl.py'
2--- charmhelpers/fetch/giturl.py 2016-01-08 14:55:15 +0000
3+++ charmhelpers/fetch/giturl.py 2016-01-22 09:43:44 +0000
4@@ -15,7 +15,7 @@
5 # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
6
7 import os
8-from subprocess import check_call
9+from subprocess import check_call, CalledProcessError
10 from charmhelpers.fetch import (
11 BaseFetchHandler,
12 UnhandledSource,
13@@ -63,6 +63,8 @@
14 branch_name)
15 try:
16 self.clone(source, dest_dir, branch, depth)
17+ except CalledProcessError as e:
18+ raise UnhandledSource(e)
19 except OSError as e:
20 raise UnhandledSource(e.strerror)
21 return dest_dir

Subscribers

People subscribed via source and target branches