~seyeongkim/charms/trusty/nova-compute/lp1417891

« back to all changes in this revision

Viewing changes to tests/charmhelpers/__init__.py

  • Committer: Corey Bryant
  • Date: 2014-12-11 17:48:48 UTC
  • mto: This revision was merged to the branch mainline in revision 93.
  • Revision ID: corey.bryant@canonical.com-20141211174848-tzsdbxhx11qoev9v
Sync charm-helpers and actually pick up charmhelpers/__init__.py this time.

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