~le-charmers/charms/trusty/rabbitmq-server/leadership-election

« back to all changes in this revision

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

  • Committer: Liam Young
  • Date: 2015-05-11 08:03:57 UTC
  • mfrom: (83.1.14 rabbitmq-server)
  • Revision ID: liam.young@canonical.com-20150511080357-3ftop9kxb6o0e3mq
Merged trunk in + LE charmhelper sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
             repository: 'git://git.openstack.org/openstack/requirements.git',
511
511
             branch: 'stable/icehouse'}
512
512
        directory: /mnt/openstack-git
 
513
        http_proxy: http://squid.internal:3128
 
514
        https_proxy: https://squid.internal:3128
513
515
 
514
 
        The directory key is optional.
 
516
        The directory, http_proxy, and https_proxy keys are optional.
515
517
    """
516
518
    global requirements_dir
517
519
    parent_dir = '/mnt/openstack-git'
522
524
    projects = yaml.load(projects_yaml)
523
525
    _git_validate_projects_yaml(projects, core_project)
524
526
 
 
527
    old_environ = dict(os.environ)
 
528
 
 
529
    if 'http_proxy' in projects.keys():
 
530
        os.environ['http_proxy'] = projects['http_proxy']
 
531
    if 'https_proxy' in projects.keys():
 
532
        os.environ['https_proxy'] = projects['https_proxy']
 
533
 
525
534
    if 'directory' in projects.keys():
526
535
        parent_dir = projects['directory']
527
536
 
536
545
            repo_dir = _git_clone_and_install_single(repo, branch, parent_dir,
537
546
                                                     update_requirements=True)
538
547
 
 
548
    os.environ = old_environ
 
549
 
539
550
 
540
551
def _git_validate_projects_yaml(projects, core_project):
541
552
    """