Add Python 3.x support in set_configs.py
Change-Id: I348c69e5411135da8434e9278a48a5777ff2a72d Partially-Implements: blueprint python3
This commit is contained in:
parent
7670611aa4
commit
dab8cae9b2
@ -135,6 +135,7 @@ RUN yum install -y \
|
|||||||
python \
|
python \
|
||||||
python-jinja2 \
|
python-jinja2 \
|
||||||
python-kazoo \
|
python-kazoo \
|
||||||
|
python-six \
|
||||||
&& yum clean all
|
&& yum clean all
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -172,6 +173,7 @@ RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD
|
|||||||
python \
|
python \
|
||||||
python-jinja2 \
|
python-jinja2 \
|
||||||
python-kazoo \
|
python-kazoo \
|
||||||
|
python-six \
|
||||||
curl \
|
curl \
|
||||||
&& apt-get clean \
|
&& 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 \
|
&& 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 \
|
||||||
|
@ -19,10 +19,10 @@ import os
|
|||||||
from pwd import getpwnam
|
from pwd import getpwnam
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import urlparse
|
|
||||||
|
|
||||||
from kazoo import client as kz_client
|
from kazoo import client as kz_client
|
||||||
from kazoo import exceptions as kz_exceptions
|
from kazoo import exceptions as kz_exceptions
|
||||||
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
|
|
||||||
# TODO(rhallisey): add docstring.
|
# TODO(rhallisey): add docstring.
|
||||||
@ -85,7 +85,7 @@ def zk_connection(url):
|
|||||||
|
|
||||||
zk_hosts = os.environ.get("KOLLA_ZK_HOSTS")
|
zk_hosts = os.environ.get("KOLLA_ZK_HOSTS")
|
||||||
if zk_hosts is None:
|
if zk_hosts is None:
|
||||||
components = urlparse.urlparse(url)
|
components = parse.urlparse(url)
|
||||||
zk_hosts = components.netloc
|
zk_hosts = components.netloc
|
||||||
zk = kz_client.KazooClient(hosts=zk_hosts)
|
zk = kz_client.KazooClient(hosts=zk_hosts)
|
||||||
zk.start()
|
zk.start()
|
||||||
@ -97,7 +97,7 @@ def zk_connection(url):
|
|||||||
|
|
||||||
def zk_path_exists(zk, path):
|
def zk_path_exists(zk, path):
|
||||||
try:
|
try:
|
||||||
components = urlparse.urlparse(path)
|
components = parse.urlparse(path)
|
||||||
zk.get(components.path)
|
zk.get(components.path)
|
||||||
return True
|
return True
|
||||||
except kz_exceptions.NoNodeError:
|
except kz_exceptions.NoNodeError:
|
||||||
@ -141,7 +141,7 @@ def copy_files(data):
|
|||||||
|
|
||||||
if is_zk_transport(source):
|
if is_zk_transport(source):
|
||||||
with zk_connection(source) as zk:
|
with zk_connection(source) as zk:
|
||||||
components = urlparse.urlparse(source)
|
components = parse.urlparse(source)
|
||||||
return zk_copy_tree(zk, components.path, dest)
|
return zk_copy_tree(zk, components.path, dest)
|
||||||
|
|
||||||
if os.path.isdir(source):
|
if os.path.isdir(source):
|
||||||
|
@ -100,7 +100,8 @@ RUN ln -s openstack-base-source/* /requirements \
|
|||||||
python-zaqarclient \
|
python-zaqarclient \
|
||||||
python-openstackclient \
|
python-openstackclient \
|
||||||
MySQL-python \
|
MySQL-python \
|
||||||
python-memcached
|
python-memcached \
|
||||||
|
six
|
||||||
ENV PATH /var/lib/kolla/venv/bin:$PATH
|
ENV PATH /var/lib/kolla/venv/bin:$PATH
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user