56.3.8
by Corey Bryant
Sync charm-helpers and actually pick up charmhelpers/__init__.py this time. |
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 |