Skip to content

Commit

Permalink
Changed X_ENV env variable name to X-ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaywk7 committed Jul 29, 2024
1 parent 8d8e578 commit be627e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion elastalert/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'ES_URL_PREFIX': 'es_url_prefix',
'STATSD_INSTANCE_TAG': 'statsd_instance_tag',
'STATSD_HOST': 'statsd_host',
'X_ENV':'X_ENV'}
'X-ENV':'X-ENV'}

env = Env(ES_USE_SSL=bool)

Expand Down
4 changes: 2 additions & 2 deletions elastalert/elastalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ def get_ch_data(self, rule, starttime, endtime, agg_key, freshquery,aggregation)
}
try:
headers = {}
if 'X_ENV' in rule:
headers['X-ENV'] = rule['X_ENV']
if 'X-ENV' in rule:
headers['X-ENV'] = rule['X-ENV']
res = requests.post(self.query_endpoint, json=data, headers=headers)
res.raise_for_status()
except requests.exceptions.RequestException as e:
Expand Down
8 changes: 4 additions & 4 deletions elastalert/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ def build_adapter_conn_config(conf):
elif 'es_bearer' in conf:
parsed_conf['es_bearer'] = conf['es_bearer']

if os.environ.get('X_ENV'):
parsed_conf['headers']['X-ENV'] = os.environ.get('X_ENV')
elif 'X_ENV' in conf:
parsed_conf['headers']['X-ENV'] = os.environ.get('X_ENV')
if os.environ.get('X-ENV'):
parsed_conf['headers']['X-ENV'] = os.environ.get('X-ENV')
elif 'X-ENV' in conf:
parsed_conf['headers']['X-ENV'] = os.environ.get('X-ENV')

if 'aws_region' in conf:
parsed_conf['aws_region'] = conf['aws_region']
Expand Down

0 comments on commit be627e7

Please sign in to comment.