From dc42946ff342d4189169d40b3bcb35917fece868 Mon Sep 17 00:00:00 2001 From: Amol Gautam Date: Wed, 6 Apr 2022 22:39:17 -0400 Subject: [PATCH] Removed migration check conditions in citi_db_wrapper --- awx/conf/settings.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/awx/conf/settings.py b/awx/conf/settings.py index 9aad42010c..3b94ba61dc 100644 --- a/awx/conf/settings.py +++ b/awx/conf/settings.py @@ -81,17 +81,16 @@ def _ctit_db_wrapper(trans_safe=False): yield except DBError as exc: if trans_safe: - if 'migrate' not in sys.argv and 'check_migrations' not in sys.argv: - level = logger.exception - if isinstance(exc, ProgrammingError): - if 'relation' in str(exc) and 'does not exist' in str(exc): - # this generally means we can't fetch Tower configuration - # because the database hasn't actually finished migrating yet; - # this is usually a sign that a service in a container (such as ws_broadcast) - # has come up *before* the database has finished migrating, and - # especially that the conf.settings table doesn't exist yet - level = logger.debug - level('Database settings are not available, using defaults.') + level = logger.exception + if isinstance(exc, ProgrammingError): + if 'relation' in str(exc) and 'does not exist' in str(exc): + # this generally means we can't fetch Tower configuration + # because the database hasn't actually finished migrating yet; + # this is usually a sign that a service in a container (such as ws_broadcast) + # has come up *before* the database has finished migrating, and + # especially that the conf.settings table doesn't exist yet + level = logger.debug + level('Database settings are not available, using defaults.') else: logger.exception('Error modifying something related to database settings.') finally: