From: Matthew Jordan Date: Wed, 28 May 2014 17:43:36 +0000 (+0000) Subject: ast-db-manage/cdr/env.py: Don't fail if a config file can't be loaded X-Git-Tag: 12.4.0-rc1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7be30fb57a54a3615629c82de212ad299358b4a1;p=thirdparty%2Fasterisk.git ast-db-manage/cdr/env.py: Don't fail if a config file can't be loaded When generating SQL files via the repotools alembic_creator.py script, a configuration object is used programatically with SQLAlechemy, as opposed to a configuration file. This patch ignores failures to interpret a config file, as ... there isn't one in this case. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414763 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/contrib/ast-db-manage/cdr/env.py b/contrib/ast-db-manage/cdr/env.py index f72400b107..6740d5906d 100755 --- a/contrib/ast-db-manage/cdr/env.py +++ b/contrib/ast-db-manage/cdr/env.py @@ -9,7 +9,10 @@ config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. -fileConfig(config.config_file_name) +try: + fileConfig(config.config_file_name) +except: + pass # add your model's MetaData object here # for 'autogenerate' support