Skip to content

Commit 7f980e3

Browse files
author
Mike Cayanan
committed
Use get_package_script_path for db_create.py execution
- Update send_mozartconf to find db_create.py in PyPI or editable installs - Maintains backwards compatibility with both installation types
1 parent 0d34e14 commit 7f980e3

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

sdscli/adapters/hysds/fabfile.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,12 +1222,9 @@ def send_mozartconf():
12221222
# Create data directory and initialize database
12231223
with prefix('source ~/mozart/bin/activate'):
12241224
mkdir('~/mozart/data', context['OPS_USER'], context['OPS_USER'])
1225-
# TODO: Convert db_create.py to console script in Phase 2
1226-
if is_pypi_install():
1227-
run('python -m mozart.db_create')
1228-
else:
1229-
with cd('~/mozart/ops/mozart'):
1230-
run('./db_create.py')
1225+
# Find db_create.py script in PyPI or editable install location
1226+
db_create_script = get_package_script_path('mozart', 'scripts/db_create.py')
1227+
run(f'python {db_create_script}')
12311228

12321229

12331230
def send_hysds_ui_conf():

0 commit comments

Comments
 (0)