@@ -43,9 +43,17 @@ def initialize_cassandra_directory():
43
43
else :
44
44
print ('Directory already exists ' + config_dir )
45
45
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
+
46
54
cert_found = False
47
55
48
- for one_path in site . getusersitepackages () :
56
+ for one_path in local_repos :
49
57
cert_install_file = os .path .join (one_path , 'cqlsh_expansion' , 'sf-class2-root.crt' )
50
58
if os .path .exists (cert_install_file ):
51
59
print ('Copying cert from ' + cert_install_file + ' to ' + cert_dest_file )
@@ -54,7 +62,7 @@ def initialize_cassandra_directory():
54
62
break
55
63
56
64
if not cert_found :
57
- for one_path in site . getsitepackages () :
65
+ for one_path in global_repos :
58
66
cert_install_file = os .path .join (one_path , 'cqlsh_expansion' , 'sf-class2-root.crt' )
59
67
if os .path .exists (cert_install_file ):
60
68
print ('Copying cert from ' + cert_install_file + ' to ' + cert_dest_file )
@@ -66,7 +74,7 @@ def initialize_cassandra_directory():
66
74
print ('sf-class2-root.crt not found ' )
67
75
68
76
cqlshrc_found = False
69
- for one_path in site . getusersitepackages () :
77
+ for one_path in local_repos :
70
78
cqlshrc_install_file = os .path .join (one_path , 'cqlsh_expansion' , 'cqlshrc_template' )
71
79
if os .path .exists (cqlshrc_install_file ):
72
80
print ('Copying cqlshrc from ' + cqlshrc_install_file + ' to ' + cqlshrc_dest_file )
@@ -75,7 +83,7 @@ def initialize_cassandra_directory():
75
83
break
76
84
77
85
if not cqlshrc_found :
78
- for one_path in site . getsitepackages () :
86
+ for one_path in global_repos :
79
87
cqlshrc_install_file = os .path .join (one_path , 'cqlsh_expansion' , 'cqlshrc_template' )
80
88
if os .path .exists (cqlshrc_install_file ):
81
89
print ('Copying cqlshrc from ' + cqlshrc_install_file + ' to ' + cqlshrc_dest_file )
0 commit comments