mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-30 11:19:44 -04:00
bump utils to 13.1.0
brings in changes to allow logging json to sdout on cloudfoundry boxes
This commit is contained in:
@@ -77,11 +77,7 @@ def create_app():
|
||||
|
||||
application = Flask(__name__)
|
||||
|
||||
if os.getenv('VCAP_APPLICATION') is not None:
|
||||
vcap_application = json.loads(os.environ.get('VCAP_APPLICATION'))
|
||||
notify_environment = vcap_application['space_name']
|
||||
else:
|
||||
notify_environment = os.environ['NOTIFY_ENVIRONMENT']
|
||||
notify_environment = os.environ['NOTIFY_ENVIRONMENT']
|
||||
|
||||
application.config.from_object(configs[notify_environment])
|
||||
|
||||
|
||||
@@ -9,10 +9,15 @@ import json
|
||||
|
||||
def extract_cloudfoundry_config():
|
||||
vcap_services = json.loads(os.environ['VCAP_SERVICES'])
|
||||
|
||||
set_config_env_vars(vcap_services)
|
||||
|
||||
|
||||
def set_config_env_vars(vcap_services):
|
||||
vcap_application = json.loads(os.environ.get('VCAP_APPLICATION'))
|
||||
os.environ['NOTIFY_ENVIRONMENT'] = vcap_application['space_name']
|
||||
os.environ['LOGGING_STDOUT_JSON'] = '1'
|
||||
|
||||
for s in vcap_services['user-provided']:
|
||||
if s['name'] == 'notify-config':
|
||||
extract_notify_config(s)
|
||||
|
||||
@@ -20,7 +20,9 @@ class Config(object):
|
||||
# Hosted graphite statsd prefix
|
||||
STATSD_PREFIX = os.getenv('STATSD_PREFIX')
|
||||
|
||||
# Logging
|
||||
DEBUG = False
|
||||
LOGGING_STDOUT_JSON = os.getenv('LOGGING_STDOUT_JSON') == '1'
|
||||
|
||||
DESKPRO_DEPT_ID = 5
|
||||
DESKPRO_ASSIGNED_AGENT_TEAM_ID = 5
|
||||
@@ -122,9 +124,7 @@ class Live(Config):
|
||||
|
||||
|
||||
class CloudFoundryConfig(Config):
|
||||
# debug on true is a less than ideal hack to enable stdout/stderr logging
|
||||
# TODO: replace this!
|
||||
DEBUG = True
|
||||
pass
|
||||
|
||||
|
||||
# CloudFoundry sandbox
|
||||
|
||||
Reference in New Issue
Block a user