~hopem/charms/trusty/keystone/lp1518975

« back to all changes in this revision

Viewing changes to charmhelpers/contrib/openstack/utils.py

  • Committer: Corey Bryant
  • Date: 2016-01-11 20:41:12 UTC
  • mfrom: (196.1.1 keystone)
  • Revision ID: corey.bryant@canonical.com-20160111204112-l6yzdok0sxoueq9m
[corey.bryant,r=osci] Sync charm-helpers.

Enable sync of payload.archive, sync charm-helpers, and fixup unit test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
593
593
    return yaml.load(projects_yaml)
594
594
 
595
595
 
596
 
def git_clone_and_install(projects_yaml, core_project, depth=1):
 
596
def git_clone_and_install(projects_yaml, core_project):
597
597
    """
598
598
    Clone/install all specified OpenStack repositories.
599
599
 
643
643
    for p in projects['repositories']:
644
644
        repo = p['repository']
645
645
        branch = p['branch']
 
646
        depth = '1'
 
647
        if 'depth' in p.keys():
 
648
            depth = p['depth']
646
649
        if p['name'] == 'requirements':
647
650
            repo_dir = _git_clone_and_install_single(repo, branch, depth,
648
651
                                                     parent_dir, http_proxy,
687
690
    """
688
691
    Clone and install a single git repository.
689
692
    """
690
 
    dest_dir = os.path.join(parent_dir, os.path.basename(repo))
691
 
 
692
693
    if not os.path.exists(parent_dir):
693
694
        juju_log('Directory already exists at {}. '
694
695
                 'No need to create directory.'.format(parent_dir))
695
696
        os.mkdir(parent_dir)
696
697
 
697
 
    if not os.path.exists(dest_dir):
698
 
        juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch))
699
 
        repo_dir = install_remote(repo, dest=parent_dir, branch=branch,
700
 
                                  depth=depth)
701
 
    else:
702
 
        repo_dir = dest_dir
 
698
    juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch))
 
699
    repo_dir = install_remote(repo, dest=parent_dir, branch=branch, depth=depth)
703
700
 
704
701
    venv = os.path.join(parent_dir, 'venv')
705
702