Skip to content

Commit c873986

Browse files
laurentdroinsjpotter
authored andcommitted
The package generated by log_collector doesn't contain the Redis Enterprise Support Package
This is because we use the full path of the generated SP (including the leading "/tmp") when we build the output path. Instead, for building the output path, we should only use the SP file name. There are various ways to fix this. I went with a second capture group.
1 parent 6654955 commit c873986

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

log_collector.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,20 @@ def get_redis_enterprise_debug_info(namespace, output_dir):
8080
return
8181

8282
# get the debug file name
83-
match = re.search(r'File (.*\.gz)', out)
83+
match = re.search(r'File (/tmp/(.*\.gz))', out)
8484
if match:
85-
debug_file = match.group(1)
86-
logger.info("debug info created on pod {} in path {}".format(pod_name, debug_file))
85+
debug_file_path = match.group(1)
86+
debug_file_name = match.group(2)
87+
logger.info("debug info created on pod {} in path {}".format(pod_name, debug_file_path))
8788
else:
8889
logger.warning(
8990
"Failed to extract debug info name from output - "
9091
"Skipping collecting Redis Enterprise cluster debug info".format(out))
9192
return
9293

9394
# copy package from RS pod
94-
output_path = os.path.join(output_dir, debug_file)
95-
cmd = "kubectl -n {} cp {}:{} {}".format(namespace, pod_name, debug_file, output_path)
95+
output_path = os.path.join(output_dir, debug_file_name)
96+
cmd = "kubectl -n {} cp {}:{} {}".format(namespace, pod_name, debug_file_path, output_path)
9697
rc, out = run_shell_command(cmd)
9798
if rc:
9899
logger.warning(

0 commit comments

Comments
 (0)