~gnuoy/charms/trusty/cinder/add-nrpe-checks

« back to all changes in this revision

Viewing changes to tests/charmhelpers/__init__.py

  • Committer: Liam Young
  • Date: 2015-01-09 16:02:39 UTC
  • mfrom: (56.2.9 cinder.next)
  • Revision ID: liam.young@canonical.com-20150109160239-qldk423wxfno2ao3
Merged next in and resolved conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Bootstrap charm-helpers, installing its dependencies if necessary using
 
2
# only standard libraries.
 
3
import subprocess
 
4
import sys
 
5
 
 
6
try:
 
7
    import six  # flake8: noqa
 
8
except ImportError:
 
9
    if sys.version_info.major == 2:
 
10
        subprocess.check_call(['apt-get', 'install', '-y', 'python-six'])
 
11
    else:
 
12
        subprocess.check_call(['apt-get', 'install', '-y', 'python3-six'])
 
13
    import six  # flake8: noqa
 
14
 
 
15
try:
 
16
    import yaml  # flake8: noqa
 
17
except ImportError:
 
18
    if sys.version_info.major == 2:
 
19
        subprocess.check_call(['apt-get', 'install', '-y', 'python-yaml'])
 
20
    else:
 
21
        subprocess.check_call(['apt-get', 'install', '-y', 'python3-yaml'])
 
22
    import yaml  # flake8: noqa