| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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>
There was a problem hiding this comment.
thank you, good work!
Leaving these comments for gsoc reviews. Not approving since the PR is just for evaluation task.
Sorry, something went wrong.
|
|
||
| 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") |
There was a problem hiding this comment.
~/.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
Sorry, something went wrong.
| logger.error(f"Could not find container {container_name}") | ||
| return 1 | ||
|
|
||
| async def show_log(self, filepath: bool = False): |
There was a problem hiding this comment.
Nit: boolean variables can be named something like is_filepath for readability
Sorry, something went wrong.
| elif filepath: | ||
| logger.info(f"{log_file_path}") | ||
| return 0 |
There was a problem hiding this comment.
| 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
Sorry, something went wrong.
| elif filepath: | ||
| logger.info(f"{log_file_path}") |
There was a problem hiding this comment.
| 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
Sorry, something went wrong.
| 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) |
There was a problem hiding this comment.
this is nice!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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