Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Sep 9, 2021
1 parent bd59128 commit d0edbf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opentelemetry-api/src/opentelemetry/baggage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def set_baggage(
Returns:
A Context with the value updated
"""
baggage = dict(get_all(context=context))
if _key_regex.fullmatch(str(name)) is None or (
_value_regex.fullmatch(str(value)) is None
):
_logger.warning(
"name %s and value %s have been discarded", name, value
)
return None
baggage = dict(get_all(context=context))
baggage[name] = value
else:
baggage[name] = value
return set_value(_BAGGAGE_KEY, baggage, context=context)


Expand Down
2 changes: 2 additions & 0 deletions opentelemetry-api/tests/baggage/test_baggage_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def _inject(self, values):
"""Test helper"""
ctx = get_current()
for k, v in values.items():
from ipdb import set_trace
set_trace()
ctx = baggage.set_baggage(k, v, context=ctx)
output = {}
self.propagator.inject(output, context=ctx)
Expand Down

0 comments on commit d0edbf7

Please sign in to comment.