8000 Consolidate set_config and get_config · DataDog/datadog-lambda-python@574a6f1 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

8000
Appearance settings

Commit 574a6f1

Browse files
committed
Consolidate set_config and get_config
1 parent 9a89c27 commit 574a6f1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

datadog_lambda/config.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@
77

88

99
def get_config():
10-
global API_KEY, API_HOST
11-
setup_config()
12-
return API_KEY, API_HOST
13-
14-
15-
def setup_config():
1610
global API_KEY, API_HOST
1711
if API_KEY:
18-
return
12+
return API_KEY, API_HOST
1913
# Decrypt code should run once and variables stored outside of the function
2014
# handler so that these are decrypted once per container
2115
DD_KMS_API_KEY = os.environ.get("DD_KMS_API_KEY")
@@ -32,5 +26,4 @@ def setup_config():
3226
API_HOST = os.environ.get(
3327
"DATADOG_HOST", os.environ.get("DD_SITE", "datadoghq.com")
3428
)
35-
36-
return
29+
return API_KEY, API_HOST

0 commit comments

Comments
 (0)
0