Nicer use of dict update methods.

This commit is contained in:
Jorik Schellekens 2019-08-05 12:16:10 +01:00
parent 46e41ee08d
commit d859c34fb9

View file

@ -232,14 +232,9 @@ class PerDestinationQueue(object):
# If there is no span context then we are either blacklisting # If there is no span context then we are either blacklisting
# this destination or we are not tracing # this destination or we are not tracing
if span_context: if span_context:
if "references" not in span_context: span_context.setdefault("references", []).append(
span_context["references"] = [ opentracing.active_span_context_as_string()
opentracing.active_span_context_as_string() )
]
else:
span_context["references"].append(
opentracing.active_span_context_as_string()
)
edu_dict["content"]["context"] = json.dumps( edu_dict["content"]["context"] = json.dumps(
{"opentracing": span_context} {"opentracing": span_context}
) )