aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/base/Dockerfile.j29
-rw-r--r--docker/base/set_configs.py71
-rw-r--r--docker/kolla-toolbox/Dockerfile.j23
3 files changed, 2 insertions, 81 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index ba5759bf6..22181ff9c 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -155,9 +155,6 @@ RUN yum -y install \
sudo \
which \
python \
- python-jinja2 \
- python-kazoo \
- python-six \
lvm2 \
scsi-target-utils \
iscsi-initiator-utils \
@@ -171,9 +168,6 @@ RUN yum -y install \
# Update packages
RUN yum -y install \
curl \
- python-jinja2 \
- python-kazoo \
- python-six \
sudo \
tar \
which \
@@ -207,9 +201,6 @@ RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 199369E540
&& apt-get install -y --no-install-recommends \
ca-certificates \
python \
- python-jinja2 \
- python-kazoo \
- python-six \
curl \
open-iscsi \
tgt \
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py
index dc0a7e4a5..fd22a3155 100644
--- a/docker/base/set_configs.py
+++ b/docker/base/set_configs.py
@@ -13,7 +13,6 @@
# limitations under the License.
import argparse
-import contextlib
import json
import logging
import os
@@ -21,10 +20,6 @@ import pwd
import shutil
import sys
-from kazoo import client as kz_client
-from kazoo import exceptions as kz_exceptions
-from six.moves.urllib import parse
-
# TODO(rhallisey): add docstring.
logging.basicConfig()
@@ -50,11 +45,7 @@ def validate_config(config):
def validate_source(data):
source = data.get('source')
- if is_zk_transport(source):
- with zk_connection(source) as zk:
- exists = zk_path_exists(zk, source)
- else:
- exists = os.path.exists(source)
+ exists = os.path.exists(source)
if not exists:
if data.get('optional'):
@@ -67,61 +58,6 @@ def validate_source(data):
return True
-def is_zk_transport(path):
- return path.startswith('zk://') or \
- os.environ.get("KOLLA_ZK_HOSTS") is not None
-
-
-@contextlib.contextmanager
-def zk_connection(url):
- # support an environment and url
- # if url, it should be like this:
- # zk://<address>:<port>/<path>
-
- zk_hosts = os.environ.get("KOLLA_ZK_HOSTS")
- if zk_hosts is None:
- components = parse.urlparse(url)
- zk_hosts = components.netloc
- zk = kz_client.KazooClient(hosts=zk_hosts)
- zk.start()
- try:
- yield zk
- finally:
- zk.stop()
-
-
-def zk_path_exists(zk, path):
- try:
- components = parse.urlparse(path)
- zk.get(components.path)
- return True
- except kz_exceptions.NoNodeError:
- return False
-
-
-def zk_copy_tree(zk, src, dest):
- """Recursively copy contents of url_source into dest."""
- data, stat = zk.get(src)
-
- if data:
- dest_path = os.path.dirname(dest)
- if not os.path.exists(dest_path):
- LOG.info("Creating dest parent directory: %s", dest_path)
- os.makedirs(dest_path)
-
- LOG.info("Copying %s to %s", src, dest)
- with open(dest, 'w') as df:
- df.write(data.decode("utf-8"))
-
- try:
- children = zk.get_children(src)
- except kz_exceptions.NoNodeError:
- return
- for child in children:
- zk_copy_tree(zk, os.path.join(src, child),
- os.path.join(dest, child))
-
-
def copy_files(data):
dest = data.get('dest')
source = data.get('source')
@@ -133,11 +69,6 @@ def copy_files(data):
else:
os.remove(dest)
- if is_zk_transport(source):
- with zk_connection(source) as zk:
- components = parse.urlparse(source)
- return zk_copy_tree(zk, components.path, dest)
-
if os.path.isdir(source):
source_path = source
dest_path = dest
diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2
index 8916bdc33..c206610b2 100644
--- a/docker/kolla-toolbox/Dockerfile.j2
+++ b/docker/kolla-toolbox/Dockerfile.j2
@@ -14,8 +14,7 @@ RUN yum -y install \
openssl-devel \
python-devel \
openssh-clients \
- && yum clean all \
- && rpm -e --nodeps pytz
+ && yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}