~paulgear/charms/trusty/ntpmaster/fix-python3-on-trusty

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/fetch/bzrurl.py

  • Committer: David Britton
  • Date: 2014-09-27 02:30:58 UTC
  • mfrom: (10.1.1 resync-charm-helpers)
  • Revision ID: dpb@canonical.com-20140927023058-6hvbi1kcshw3aokj
resync charmhelpers, ad makefile targets to speed up future syncs [r=dpb] [a=tribaal]

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    apt_install("python-bzrlib")
13
13
    from bzrlib.branch import Branch
14
14
 
 
15
 
15
16
class BzrUrlFetchHandler(BaseFetchHandler):
16
17
    """Handler for bazaar branches via generic and lp URLs"""
17
18
    def can_handle(self, source):
38
39
    def install(self, source):
39
40
        url_parts = self.parse_url(source)
40
41
        branch_name = url_parts.path.strip("/").split("/")[-1]
41
 
        dest_dir = os.path.join(os.environ.get('CHARM_DIR'), "fetched", branch_name)
 
42
        dest_dir = os.path.join(os.environ.get('CHARM_DIR'), "fetched",
 
43
                                branch_name)
42
44
        if not os.path.exists(dest_dir):
43
45
            mkdir(dest_dir, perms=0755)
44
46
        try:
46
48
        except OSError as e:
47
49
            raise UnhandledSource(e.strerror)
48
50
        return dest_dir
49