Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 3549: migrate apply-config-from-env.py from python2 to python3 #3614

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ RUN set -x \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& apt-get install -y --no-install-recommends gpg gpg-agent wget sudo \
&& apt-get -y --purge autoremove \
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -pv /opt \
&& cd /opt \
&& wget -q "${DISTRO_URL}" \
Expand Down
10 changes: 5 additions & 5 deletions docker/scripts/apply-config-from-env.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import os, sys

if len(sys.argv) != 2:
print 'Usage: %s ' + 'config_dir' % (sys.argv[0])
print('Usage: %s ' + 'config_dir' % (sys.argv[0]))
sys.exit(1)

def mylistdir(dir):
Expand All @@ -38,8 +38,8 @@ def mylistdir(dir):
# Always apply env config to all the files under conf
conf_dir = sys.argv[1]
conf_files = mylistdir(conf_dir)
print 'conf files: '
print conf_files
print('conf files: ')
print(conf_files)

bk_env_prefix = 'BK_'
zk_env_prefix = 'ZK_'
Expand Down Expand Up @@ -75,13 +75,13 @@ def mylistdir(dir):
if k.startswith(bk_env_prefix):
search_key = k[len(bk_env_prefix):]
if search_key in keys:
print '[%s] Applying config %s = %s' % (conf_filename, search_key, v)
print('[%s] Applying config %s = %s' % (conf_filename, search_key, v))
idx = keys[search_key]
lines[idx] = '%s=%s\n' % (search_key, v)
if k.startswith(zk_env_prefix):
search_key = k[len(zk_env_prefix):]
if search_key in keys:
print '[%s] Applying config %s = %s' % (conf_filename, search_key, v)
print('[%s] Applying config %s = %s' % (conf_filename, search_key, v))
idx = keys[search_key]
lines[idx] = '%s=%s\n' % (search_key, v)

Expand Down