Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion contents/job-wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def wait():
for line in w.stream(core_v1.read_namespaced_pod_log,
name=pod_name,
namespace=namespace):
log.info(line.encode('ascii', 'ignore'))
try:
log.info(line)
except:
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a bare except clause is not recommended as it catches all exceptions, including system exits and keyboard interrupts. Consider catching specific exceptions like UnicodeError or UnicodeEncodeError instead.

Suggested change
except:
except UnicodeEncodeError:

Copilot uses AI. Check for mistakes.
log.info(line.encode('ascii', 'ignore'))

#check status job
batch_v1 = client.BatchV1Api()
Expand Down
10 changes: 8 additions & 2 deletions contents/pods-read-logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def main():
name=data["name"],
tail_lines=os.environ.get('RD_CONFIG_NUMBER_OF_LINES'),
follow=False):
print(line.encode('ascii', 'ignore'))
try:
log.info(line)
except:
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a bare except clause is not recommended as it catches all exceptions, including system exits and keyboard interrupts. Consider catching specific exceptions like UnicodeError or UnicodeEncodeError instead.

Suggested change
except:
except UnicodeError:

Copilot uses AI. Check for mistakes.
log.info(line.encode('ascii', 'ignore'))
else:
w = watch.Watch()
for line in w.stream(v1.read_namespaced_pod_log,
Expand All @@ -44,7 +47,10 @@ def main():
name=data["name"],
tail_lines=os.environ.get('RD_CONFIG_NUMBER_OF_LINES'),
follow=False):
print(line.encode('ascii', 'ignore'))
try:
log.info(line)
except:
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a bare except clause is not recommended as it catches all exceptions, including system exits and keyboard interrupts. Consider catching specific exceptions like UnicodeError or UnicodeEncodeError instead.

Suggested change
except:
except UnicodeError:

Copilot uses AI. Check for mistakes.
log.info(line.encode('ascii', 'ignore'))
else:
if data["container_name"]:
ret = v1.read_namespaced_pod_log(
Expand Down