@@ -159,22 +159,14 @@ def config_join(*args):
159159 sheds_config_path = _configure_sheds_config_file (
160160 ctx , config_directory , ** kwds
161161 )
162- preseeded_database = True
163162 master_api_key = kwds .get ("master_api_key" , "test_key" )
164163 dependency_dir = os .path .join (config_directory , "deps" )
165- galaxy_sqlite_database = kwds .get ("galaxy_sqlite_database" , None )
166- try :
167- _download_database_template (
168- galaxy_root ,
169- database_location ,
170- latest = latest_galaxy ,
171- galaxy_sqlite_database = galaxy_sqlite_database ,
172- )
173- except Exception as e :
174- print (e )
175- # No network access - just roll forward from null.
176- preseeded_database = False
177-
164+ preseeded_database = attempt_database_preseed (
165+ galaxy_root ,
166+ database_location ,
167+ latest_galaxy = latest_galaxy ,
168+ ** kwds
169+ )
178170 os .makedirs (shed_tools_path )
179171 server_name = "planemo%d" % random .randint (0 , 100000 )
180172 port = int (kwds .get ("port" , 9090 ))
@@ -381,6 +373,25 @@ def cleanup(self):
381373 shutil .rmtree (self .config_directory )
382374
383375
376+ def attempt_database_preseed (
377+ effective_galaxy_root , database_location , latest_galaxy = False , ** kwds
378+ ):
379+ preseeded_database = True
380+ galaxy_sqlite_database = kwds .get ("galaxy_database_seed" , None )
381+ try :
382+ _download_database_template (
383+ effective_galaxy_root ,
384+ database_location ,
385+ latest = latest_galaxy ,
386+ galaxy_sqlite_database = galaxy_sqlite_database ,
387+ )
388+ except Exception as e :
389+ print (e )
390+ # No network access - just roll forward from null.
391+ preseeded_database = False
392+ return preseeded_database
393+
394+
384395def _download_database_template (
385396 galaxy_root ,
386397 database_location ,
0 commit comments