Skip to content

Commit

Permalink
feat: remove paver update_db in depr (#32832)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yagnesh1998 authored Jul 25, 2023
1 parent 3426901 commit 0212767
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
16 changes: 0 additions & 16 deletions pavelib/paver_tests/test_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,6 @@ def test_celery(self, options):
call_task("pavelib.servers.celery", options=options)
assert self.task_messages == [EXPECTED_CELERY_COMMAND.format(settings=settings)]

@ddt.data(
[{}],
[{"settings": "aws"}],
)
@ddt.unpack
def test_update_db(self, options):
"""
Test the "update_db" task.
"""
settings = options.get("settings", Env.DEVSTACK_SETTINGS)
call_task("pavelib.servers.update_db", options=options)
# pylint: disable=line-too-long
db_command = "NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE={settings} /edx/bin/edxapp-migrate-{server} --traceback --pythonpath=. "
assert self.task_messages == [db_command.format(server='lms', settings=settings),
db_command.format(server='cms', settings=settings)]

@ddt.data(
["lms", {}],
["lms", {"settings": "aws"}],
Expand Down
21 changes: 0 additions & 21 deletions pavelib/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,27 +233,6 @@ def run_all_servers(options):
])


@task
@needs('pavelib.prereqs.install_prereqs')
@cmdopts([
("settings=", "s", "Django settings"),
("fake-initial", None, "Fake the initial migrations"),
])
@timed
def update_db(options):
"""
Migrates the lms and cms across all databases
"""
settings = getattr(options, 'settings', DEFAULT_SETTINGS)
fake = "--fake-initial" if getattr(options, 'fake_initial', False) else ""
for system in ('lms', 'cms'):
# pylint: disable=line-too-long
sh("NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE={settings} /edx/bin/edxapp-migrate-{system} --traceback --pythonpath=. {fake}".format(
settings=settings,
system=system,
fake=fake))


@task
@needs('pavelib.prereqs.install_prereqs')
@consume_args
Expand Down

0 comments on commit 0212767

Please sign in to comment.