~corey.bryant/charms/trusty/swift-proxy/python-six

« back to all changes in this revision

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

  • Committer: Corey Bryant
  • Date: 2014-12-04 17:50:21 UTC
  • Revision ID: corey.bryant@canonical.com-20141204175021-in3z5jquagvnal8q
Sync charm-helpers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        repo = Repo.clone_from(source, dest)
35
35
        repo.git.checkout(branch)
36
36
 
37
 
    def install(self, source, branch="master"):
 
37
    def install(self, source, branch="master", dest=None):
38
38
        url_parts = self.parse_url(source)
39
39
        branch_name = url_parts.path.strip("/").split("/")[-1]
40
 
        dest_dir = os.path.join(os.environ.get('CHARM_DIR'), "fetched",
41
 
                                branch_name)
 
40
        if dest:
 
41
            dest_dir = os.path.join(dest, branch_name)
 
42
        else:
 
43
            dest_dir = os.path.join(os.environ.get('CHARM_DIR'), "fetched",
 
44
                                    branch_name)
42
45
        if not os.path.exists(dest_dir):
43
46
            mkdir(dest_dir, perms=0o755)
44
47
        try: