REQUIREMENTS_TXT = "requirements.txt"
-class CommandExecutorHandler():
+class CommandExecutorHandler:
def __init__(self, request):
self.request = request
payload_section = []
is_payload_section = False
+ ### extract the original header request into sys-env variables
+ ### RequestID
+ request_id = request.requestId
+ ### Sub-requestID
+ subrequest_id = request.correlationId
+ request_id_map = {'CDS_REQUEST_ID':request_id, 'CDS_CORRELATION_ID':subrequest_id}
+ updated_env = { **os.environ, **request_id_map }
+
try:
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
- shell=True, bufsize=1, universal_newlines=True) as newProcess:
+ shell=True, bufsize=1, universal_newlines=True, env=updated_env) as newProcess:
while True:
output = newProcess.stdout.readline()
if output == '' and newProcess.poll() is not None: