Skip to content

Commit 0a419e4

Browse files
committed
updated post install
1 parent 7ba6275 commit 0a419e4

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ RUN mkdir $AWS_KEYSPACES_WORKING_DIR/bin
1414
#Install jq
1515
RUN yum install -y jq && yum install python3-pip -y && yum clean all
1616

17-
RUN pip3 install importlib-metadata
18-
RUN pip3 install boto3
19-
RUN pip3 install six
20-
RUN pip3 install -i https://test.pypi.org/simple/ cqlsh-expansion-mjpr==0.9.16
17+
18+
RUN pip3 install cqlsh-expansion==0.9.5
2119

2220
RUN cqlsh-expansion.init
2321

cqlsh-expansion/cqlsh_expansion/post_install.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,17 @@ def initialize_cassandra_directory():
4343
else:
4444
print('Directory already exists ' + config_dir)
4545

46+
local_repos = site.getusersitepackages()
47+
if isinstance(local_repos, str):
48+
local_repos = [site.getusersitepackages()]
49+
50+
global_repos = site.getsitepackages()
51+
if isinstance(global_repos, str):
52+
global_repos = [site.getusersitepackages()]
53+
4654
cert_found = False
4755

48-
for one_path in site.getusersitepackages():
56+
for one_path in local_repos:
4957
cert_install_file = os.path.join(one_path, 'cqlsh_expansion', 'sf-class2-root.crt')
5058
if os.path.exists(cert_install_file):
5159
print('Copying cert from ' + cert_install_file + ' to ' + cert_dest_file)
@@ -54,7 +62,7 @@ def initialize_cassandra_directory():
5462
break
5563

5664
if not cert_found:
57-
for one_path in site.getsitepackages():
65+
for one_path in global_repos:
5866
cert_install_file = os.path.join(one_path, 'cqlsh_expansion', 'sf-class2-root.crt')
5967
if os.path.exists(cert_install_file):
6068
print('Copying cert from ' + cert_install_file + ' to ' + cert_dest_file)
@@ -66,7 +74,7 @@ def initialize_cassandra_directory():
6674
print('sf-class2-root.crt not found ')
6775

6876
cqlshrc_found = False
69-
for one_path in site.getusersitepackages():
77+
for one_path in local_repos:
7078
cqlshrc_install_file = os.path.join(one_path, 'cqlsh_expansion', 'cqlshrc_template')
7179
if os.path.exists(cqlshrc_install_file):
7280
print('Copying cqlshrc from ' + cqlshrc_install_file + ' to ' + cqlshrc_dest_file)
@@ -75,7 +83,7 @@ def initialize_cassandra_directory():
7583
break
7684

7785
if not cqlshrc_found:
78-
for one_path in site.getsitepackages():
86+
for one_path in global_repos:
7987
cqlshrc_install_file = os.path.join(one_path, 'cqlsh_expansion', 'cqlshrc_template')
8088
if os.path.exists(cqlshrc_install_file):
8189
print('Copying cqlshrc from '+ cqlshrc_install_file + ' to ' + cqlshrc_dest_file)

cqlsh-expansion/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
six>1.14.0
1+
six>=1.12.0
22
cassandra-driver
3-
boto3>=1.16
3+
boto3
44
cassandra-sigv4>=4.0.2

cqlsh-expansion/setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
# Setting up
1010
setup(
11-
name="cqlsh-expansion-mjpr",
12-
version='0.9.16',
11+
name="cqlsh-expansion",
12+
version='0.9.5',
1313
description='The cqlsh-expansion utility extends native cqlsh functionality to include cloud native capabilities',
1414
long_description=long_description,
1515
long_description_content_type='text/markdown',
1616
url = 'https://github.com/aws-samples/amazon-keyspaces-toolkit/tree/master/cqlsh-expansion',
1717
python_requires='>=3.6',
1818
install_requires=[
19-
"six>1.14.0",
19+
"six>=1.12.0",
2020
"cassandra-driver",
21-
"boto3>=1.16",
21+
"boto3",
2222
"cassandra-sigv4>=4.0.2",
2323
],
2424
classifiers=[

0 commit comments

Comments
 (0)