Skip to content

Commit 2545620

Browse files
committed
add small improvements
1 parent 821ad66 commit 2545620

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ceph_devstack/resources/ceph/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,17 @@ async def logs(
240240
except FileNotFoundError:
241241
logger.error("No log file found")
242242
except TooManyJobsFound:
243-
logger.error("Found too many jobs for provided. Please pick a job id")
243+
logger.error(
244+
"Found too many jobs for target run. Please pick a job id with -j flag."
245+
)
244246
else:
245247
if locate:
246248
print(log_file)
247249
else:
250+
buffer_size = 8 * 1024
248251
with open(log_file) as f:
249-
print(f.read())
252+
while chunk := f.read(buffer_size):
253+
print(chunk)
250254

251255
def get_log_file(self, run_name: str = None, job_id: str = None):
252256
archive_dir = Teuthology().archive_dir.expanduser()

ceph_devstack/resources/test/test_devstack.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,4 @@ def create_logfile(self, data_dir: str, **kwargs):
147147
log_file = f"{log_dir}/teuthology.log"
148148
with open(log_file, "w") as f:
149149
f.write(content)
150-
print(log_file)
151150
return log_file

0 commit comments

Comments
 (0)