FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implemented the show-log command along with flag: -f, --filepath by MightyShashank · Pull Request #17 · ceph/ceph-devstack · GitHub

Repository navigation

Implemented the show-log command along with flag: -f, --filepath - #17

Open
MightyShashank wants to merge 9 commits into
ceph:mainfrom
MightyShashank:main
Open

MightyShashank wants to merge 9 commits into
ceph:mainfrom
MightyShashank:main

Conversation

Copy link
Copy Markdown

The show-log command displays the contents of the most recent teuthology.log file. The optional -f or --filepath flag can be used to display only the filepath of the latest teuthology.log file instead of its contents.

Usage:
ceph-devstack show-log -f

Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
Implementation of show_log

Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
Update __init__.py to include option for --filepath flag

Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
Updated cli.py to include option for calling show-log

Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
Signed-off-by: Shashank Tippanavar <152605527+MightyShashank@users.noreply.github.com>
VallariAg self-requested a review April 2, 2025 17:04

VallariAg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

thank you, good work!

Leaving these comments for gsoc reviews. Not approving since the PR is just for evaluation task.


async def show_log(self, filepath: bool = False):
home_dir = os.path.expanduser("~")
target_dir = os.path.join(home_dir, ".local", "share", "ceph-devstack", "archive")

VallariAg Apr 9, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

~/.local/share/ceph-devstack is the default directory where archives are stored but it can be configureable with --data-dir so it's a good idea to not hardcode the archive path here

logger.error(f"Could not find container {container_name}")
return 1

async def show_log(self, filepath: bool = False):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: boolean variables can be named something like is_filepath for readability

Comment on lines +269 to +271
elif filepath:
logger.info(f"{log_file_path}")
return 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
elif filepath:
logger.info(f"{log_file_path}")
return 0
elif os.path.exists(log_file_path) and os.path.isfile(log_file_path) and filepath:
logger.info(f"{log_file_path}")
return 0

otherwise it'll print the teuthology.log file path even if job directory exists but teuthology.log file does not exist

Comment on lines +285 to +286
elif filepath:
logger.info(f"{log_file_path}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
elif filepath:
logger.info(f"{log_file_path}")
elif os.path.exists(log_file_path) and os.path.isfile(log_file_path) and filepath:
logger.info(f"{log_file_path}")

same comment as above

except Exception as e:
logger.error(f"Error extracting timestamp from {dir_name}: {e}")
return None
run_directories_list.sort(key=lambda dir: extract_timestamp(dir), reverse=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this is nice!

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL