From cdc5cc6222f3d903720dcf751be2dddb09931429 Mon Sep 17 00:00:00 2001 From: Devendra Singh Date: Wed, 16 Oct 2019 12:42:05 +0530 Subject: [PATCH] MongoDB engine upgrade --- upgrade/helpers/tasks.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/upgrade/helpers/tasks.py b/upgrade/helpers/tasks.py index 5b9d31a0..f136aa06 100644 --- a/upgrade/helpers/tasks.py +++ b/upgrade/helpers/tasks.py @@ -998,3 +998,20 @@ def upgrade_validation(upgrade_type=False): if upgrade_type: run('hammer ping', warn_only=True) run('katello-service status', warn_only=True) + + +def mongo_db_engine_upgrade(upgrade_type): + """ + The purpose of this method to perform the upgrade of mongo DB database engine + from MMAPv1 to WiredTiger. + :param str upgrade_type: If user select the upgrade_type 'Satellite' then mongodb + upgrade would be performed on Satellite otherwise it would be happened on Capsule + """ + logger.highlight('\n========== MongoDB DataBase Engine Upgrade =================\n') + logger.info("Upgrading the MongoDb Database on {}".format(upgrade_type)) + preup_time = datetime.now().replace(microsecond=0) + run("satellite-installer --upgrade-mongo-storage-engine") + postup_time = datetime.now().replace(microsecond=0) + logger.info("MongoDB DataBase Engine Upgraded Successfully") + logger.highlight('Time taken by MongoDB DataBase Engine Upgrade - {}'.format( + str(postup_time - preup_time)))