diff --git a/python3/examples/XenAPI/XenAPI.py b/python3/examples/XenAPI/XenAPI.py index e37f8813b6e..e62d0b76733 100644 --- a/python3/examples/XenAPI/XenAPI.py +++ b/python3/examples/XenAPI/XenAPI.py @@ -114,12 +114,18 @@ def with_tracecontext(self): # pylint: disable=possibly-used-before-assignment propagators = propagate.get_global_textmap() propagators.inject(headers, ctx) - self._extra_headers = [] + for k, v in headers.items(): self.add_extra_header(k, v) def make_connection(self, host): + self._extra_headers = [] self.with_tracecontext() + originator_k = "ORIGINATOR" + originator_v = os.getenv(originator_k, None) + if originator_v: + self.add_extra_header(originator_k.lower(), originator_v) + # compatibility with parent xmlrpclib.Transport HTTP/1.1 support if self._connection and host == self._connection[0]: return self._connection[1]