Skip to content

Commit f7554d1

Browse files
committed
Rename option --galaxy_sqlite_database_option to galaxy_database_seed_option.
This will be more consistent with an option that actually specifies Galaxy's database.
1 parent a078bdc commit f7554d1

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

planemo/galaxy/config.py

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
384395
def _download_database_template(
385396
galaxy_root,
386397
database_location,

planemo/options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def galaxy_root_option():
5454
)
5555

5656

57-
def galaxy_sqlite_database_option():
57+
def galaxy_database_seed_option():
5858
return planemo_option(
59-
"--galaxy_sqlite_database",
59+
"--galaxy_database_seed",
6060
default=None,
6161
use_global_config=True,
6262
type=click.Path(exists=True, file_okay=True, resolve_path=True),
@@ -663,7 +663,7 @@ def galaxy_config_options():
663663
def galaxy_target_options():
664664
return _compose(
665665
galaxy_root_option(),
666-
galaxy_sqlite_database_option(),
666+
galaxy_database_seed_option(),
667667
install_galaxy_option(),
668668
galaxy_branch_option(),
669669
galaxy_source_option(),

0 commit comments

Comments
 (0)