Skip to content

Commit a07278c

Browse files
committed
debugging
1 parent cb2cf5e commit a07278c

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

packaging_automation/citus_package.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def sign_packages(
242242
print(f"Result:{output}")
243243

244244
if result.returncode != 0:
245-
raise ValueError(f"Error while signing rpm files.Err:{result.stderr}")
245+
raise ValueError(f"Error while signing rpm files.Err:{result.stdout}")
246246
if input_output_parameters.output_validation:
247247
validate_output(
248248
output,
@@ -351,21 +351,18 @@ def build_package(
351351
f"{input_output_parameters.input_files_dir}:/buildfiles:ro "
352352
f"-e GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE -e CONTAINER_BUILD_RUN_ENABLED "
353353
f"-e MSRUSTUP_PAT -e CRATES_IO_MIRROR_FEED_TOKEN -e INSTALL_RUST -e CI "
354-
f"citus/{docker_image_name}:{docker_platform}-{postgres_extension} {build_type.name} 2>&1"
354+
f"citus/{docker_image_name}:{docker_platform}-{postgres_extension} {build_type.name}"
355355
)
356356

357357
print(f"Executing docker command: {docker_command}")
358358
output = run_with_output(docker_command, text=True)
359359

360-
if output.stdout:
361-
print("Output:" + output.stdout)
362360
if output.returncode != 0:
363361
raise ValueError(
364362
"Docker command failed.\n"
365363
f"Command: {docker_command}\n"
366364
f"Exit code: {output.returncode}\n"
367-
f"--- stdout ---\n{output.stdout}\n"
368-
f"--- stderr ---\n{output.stderr}\n"
365+
f"--- combined output (stdout+stderr) ---\n{output.stdout}\n"
369366
)
370367

371368
if input_output_parameters.output_validation:

packaging_automation/common_tool_methods.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,13 @@ def run_with_output(command, *args, **kwargs):
166166
# this method's main objective is to return output. Therefore it is caller's responsibility to handle
167167
# success status
168168
# pylint: disable=subprocess-run-check
169-
result = subprocess.run(shlex.split(command), *args, capture_output=True, **kwargs)
169+
result = subprocess.run(
170+
shlex.split(command),
171+
*args,
172+
stdout=subprocess.PIPE,
173+
stderr=subprocess.STDOUT,
174+
**kwargs
175+
)
170176
return result
171177

172178

0 commit comments

Comments
 (0)