@@ -134,28 +134,29 @@ def create_mountpoints():
134
134
later steps, they are created here.
135
135
"""
136
136
with qdb .sql_connection .TRN :
137
- # Insert the settings values to the database
138
- sql = """SELECT mountpoint FROM qiita.data_directory
137
+ sql = """SELECT DISTINCT mountpoint FROM qiita.data_directory
139
138
WHERE active = TRUE"""
140
139
qdb .sql_connection .TRN .add (sql )
141
140
created_subdirs = []
142
- for subdir in qdb .sql_connection .TRN .execute_fetchflatten ():
143
- if not exists (join (qiita_config .base_data_dir , subdir )):
144
- if qiita_config .test_environment and \
145
- exists (get_support_file ('test_data' , subdir )):
146
- # if in test mode, we want to potentially fill the
147
- # new directory with according test data
148
- copytree (get_support_file ('test_data' , subdir ),
149
- join (qiita_config .base_data_dir , subdir ))
150
- else :
151
- # in production mode, an empty directory is created
152
- mkdir (join (qiita_config .base_data_dir , subdir ))
153
- created_subdirs .append (subdir )
141
+ for mountpoint in qdb .sql_connection .TRN .execute_fetchflatten ():
142
+ for (ddid , subdir ) in qdb .util .get_mountpoint (mountpoint ,
143
+ retrieve_all = True ):
144
+ if not exists (join (qiita_config .base_data_dir , subdir )):
145
+ if qiita_config .test_environment and \
146
+ exists (get_support_file ('test_data' , subdir )):
147
+ # if in test mode, we want to potentially fill the
148
+ # new directory with according test data
149
+ copytree (get_support_file ('test_data' , subdir ),
150
+ join (qiita_config .base_data_dir , subdir ))
151
+ else :
152
+ # in production mode, an empty directory is created
153
+ mkdir (join (qiita_config .base_data_dir , subdir ))
154
+ created_subdirs .append (subdir )
154
155
155
156
if len (created_subdirs ) > 0 :
156
- print ("Created %i sub-directories as 'mount points' in '%s': %s"
157
- % (len (created_subdirs ), qiita_config . base_data_dir ,
158
- ', ' .join (created_subdirs )))
157
+ print ("Created %i sub-directories as 'mount points': \n %s"
158
+ % (len (created_subdirs ),
159
+ '' .join (map ( lambda x : ' - %s \n ' % x , created_subdirs ) )))
159
160
160
161
161
162
def make_environment (load_ontologies , download_reference , add_demo_user ):
0 commit comments