Removed migration check conditions in citi_db_wrapper

This commit is contained in:
Amol Gautam
2022-04-06 22:39:17 -04:00
parent 27dc8caabd
commit dc42946ff3

View File

@@ -81,17 +81,16 @@ def _ctit_db_wrapper(trans_safe=False):
yield yield
except DBError as exc: except DBError as exc:
if trans_safe: if trans_safe:
if 'migrate' not in sys.argv and 'check_migrations' not in sys.argv: level = logger.exception
level = logger.exception if isinstance(exc, ProgrammingError):
if isinstance(exc, ProgrammingError): if 'relation' in str(exc) and 'does not exist' in str(exc):
if 'relation' in str(exc) and 'does not exist' in str(exc): # this generally means we can't fetch Tower configuration
# this generally means we can't fetch Tower configuration # because the database hasn't actually finished migrating yet;
# because the database hasn't actually finished migrating yet; # this is usually a sign that a service in a container (such as ws_broadcast)
# 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
# has come up *before* the database has finished migrating, and # especially that the conf.settings table doesn't exist yet
# especially that the conf.settings table doesn't exist yet level = logger.debug
level = logger.debug level('Database settings are not available, using defaults.')
level('Database settings are not available, using defaults.')
else: else:
logger.exception('Error modifying something related to database settings.') logger.exception('Error modifying something related to database settings.')
finally: finally: