Updated start scripts to not look up envrionemnt

This commit is contained in:
Martyn Inglis
2016-07-04 17:21:08 +01:00
parent a76e3fa31d
commit fe84674a77
6 changed files with 19 additions and 51 deletions

12
wsgi.py
View File

@@ -1,21 +1,9 @@
from credstash import getAllSecrets
import os
default_env_file = '/home/ubuntu/environment'
environment = 'live'
if os.path.isfile(default_env_file):
with open(default_env_file, 'r') as environment_file:
environment = environment_file.readline().strip()
# on aws get secrets and export to env
os.environ.update(getAllSecrets(region="eu-west-1"))
from config import configs # noqa
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
from app import create_app # noqa
application = create_app()