@@ -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 )
0 commit comments