Add Python 3.x support in set_configs.py

Change-Id: I348c69e5411135da8434e9278a48a5777ff2a72d
Partially-Implements: blueprint python3
This commit is contained in:
Michal Rostecki 2015-12-07 07:15:37 +01:00
parent 7670611aa4
commit dab8cae9b2
3 changed files with 8 additions and 5 deletions

View File

@ -135,6 +135,7 @@ RUN yum install -y \
python \
python-jinja2 \
python-kazoo \
python-six \
&& yum clean all
{% endif %}
@ -172,6 +173,7 @@ RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD
python \
python-jinja2 \
python-kazoo \
python-six \
curl \
&& apt-get clean \
&& sed -i "s|'purelib': '\$base/local/lib/python\$py_version_short/dist-packages',|'purelib': '\$base/lib/python\$py_version_short/dist-packages',|;s|'platlib': '\$platbase/local/lib/python\$py_version_short/dist-packages',|'platlib': '\$platbase/lib/python\$py_version_short/dist-packages',|;s|'headers': '\$base/local/include/python\$py_version_short/\$dist_name',|'headers': '\$base/include/python\$py_version_short/\$dist_name',|;s|'scripts': '\$base/local/bin',|'scripts': '\$base/bin',|;s|'data' : '\$base/local',|'data' : '\$base',|" /usr/lib/python2.7/distutils/command/install.py \

View File

@ -19,10 +19,10 @@ import os
from pwd import getpwnam
import shutil
import sys
import urlparse
from kazoo import client as kz_client
from kazoo import exceptions as kz_exceptions
from six.moves.urllib import parse
# TODO(rhallisey): add docstring.
@ -85,7 +85,7 @@ def zk_connection(url):
zk_hosts = os.environ.get("KOLLA_ZK_HOSTS")
if zk_hosts is None:
components = urlparse.urlparse(url)
components = parse.urlparse(url)
zk_hosts = components.netloc
zk = kz_client.KazooClient(hosts=zk_hosts)
zk.start()
@ -97,7 +97,7 @@ def zk_connection(url):
def zk_path_exists(zk, path):
try:
components = urlparse.urlparse(path)
components = parse.urlparse(path)
zk.get(components.path)
return True
except kz_exceptions.NoNodeError:
@ -141,7 +141,7 @@ def copy_files(data):
if is_zk_transport(source):
with zk_connection(source) as zk:
components = urlparse.urlparse(source)
components = parse.urlparse(source)
return zk_copy_tree(zk, components.path, dest)
if os.path.isdir(source):

View File

@ -100,7 +100,8 @@ RUN ln -s openstack-base-source/* /requirements \
python-zaqarclient \
python-openstackclient \
MySQL-python \
python-memcached
python-memcached \
six
ENV PATH /var/lib/kolla/venv/bin:$PATH
{% endif %}