~bcsaller/charms/trusty/cloudfoundry/progressbar

« back to all changes in this revision

Viewing changes to cfdeploy

  • Committer: Benjamin Saller
  • Date: 2014-11-12 21:25:12 UTC
  • Revision ID: benjamin.saller@canonical.com-20141112212512-ml8ekx7nnxkrpr68
attempt to install deps from the wheelhouse, needs verification

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
# modeline vim:set syntax=python
3
 
execfile('.tox/py27/bin/activate_this.py',
4
 
         dict(__file__='.tox/py27/bin/activate_this.py'))
 
3
import os
 
4
import subprocess
 
5
 
 
6
 
 
7
def verify_dep(name):
 
8
    try:
 
9
        __import__(name)
 
10
        return True
 
11
    except ImportError:
 
12
        return False
 
13
 
 
14
 
 
15
def install_deps():
 
16
    if not verify_dep('wheel'):
 
17
        subprocess.check_call(['sudo', 'pip', 'install', 'wheel'])
 
18
    for dep in ['jujuclient', 'progress', 'requests']:
 
19
        if not verify_dep(dep):
 
20
            subprocess.check_call(['sudo', 'pip', 'install',
 
21
                                   '--use-wheel', '--find-links',
 
22
                                   os.path.abspath('wheelhouse'),
 
23
                                   dep])
 
24
install_deps()
 
25
 
5
26
import argparse
6
27
import logging
7
28
import sys