Skip to content

Commit 6a542e9

Browse files
committed
Pass section to env vars
Otherwise you can't actually pass env vars as config
1 parent de671af commit 6a542e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/recceiver/processors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
]
2323

2424

25-
def _env_vars():
26-
prefix = "RECCEIVER_"
25+
def _env_vars(section: str) -> dict[str, str]:
26+
prefix = "RECCEIVER_" + section.upper() + "_"
2727
return {k.removeprefix(prefix).lower(): v for k, v in os.environ.items() if k.startswith(prefix)}
2828

2929

3030
class ConfigAdapter(object):
3131
def __init__(self, conf, section):
3232
self._C, self._S = conf, section
33-
self.env_vars = _env_vars()
33+
self.env_vars = _env_vars(section)
3434

3535
def __len__(self):
3636
return len(self._C.items(self._S, raw=True))

0 commit comments

Comments
 (0)