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
=== modified file 'charmhelpers/fetch/giturl.py'
--- charmhelpers/fetch/giturl.py 2016-01-08 14:55:15 +0000
+++ charmhelpers/fetch/giturl.py 2016-01-22 09:43:44 +0000
@@ -15,7 +15,7 @@
15# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.15# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
1616
17import os17import os
18from subprocess import check_call18from subprocess import check_call, CalledProcessError
19from charmhelpers.fetch import (19from charmhelpers.fetch import (
20 BaseFetchHandler,20 BaseFetchHandler,
21 UnhandledSource,21 UnhandledSource,
@@ -63,6 +63,8 @@
63 branch_name)63 branch_name)
64 try:64 try:
65 self.clone(source, dest_dir, branch, depth)65 self.clone(source, dest_dir, branch, depth)
66 except CalledProcessError as e:
67 raise UnhandledSource(e)
66 except OSError as e:68 except OSError as e:
67 raise UnhandledSource(e.strerror)69 raise UnhandledSource(e.strerror)
68 return dest_dir70 return dest_dir

Subscribers

People subscribed via source and target branches