-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure subp doesn't run during logs.py import #5268
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheRealFalcon the PR looks good, but I think some of the changes meant for the fix PR ended up in the cleanup PR, and tests fail on the first commit:
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectInstallerLogs::test_include_installer_logs_when_present[no_files_include_userdata] - AttributeError: module 'cloudinit.cmd.devel.logs' has no attribute '_collect_installer_logs'. Did you mean: 'collect_installer_logs'?
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectInstallerLogs::test_include_installer_logs_when_present[no_files_exclude_userdata] - AttributeError: module 'cloudinit.cmd.devel.logs' has no attribute '_collect_installer_logs'. Did you mean: 'collect_installer_logs'?
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectInstallerLogs::test_include_installer_logs_when_present[files_and_dirs_include_userdata] - AttributeError: module 'cloudinit.cmd.devel.logs' has no attribute '_collect_installer_logs'. Did you mean: 'collect_installer_logs'?
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectInstallerLogs::test_include_installer_logs_when_present[files_and_dirs_exclude_userdata] - AttributeError: module 'cloudinit.cmd.devel.logs' has no attribute '_collect_installer_logs'. Did you mean: 'collect_installer_logs'?
instance_data_sensitive: str | ||
|
||
|
||
def get_log_paths(init: Optional[Init] = None) -> LogPaths: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 nice
@@ -1050,7 +1050,7 @@ def main(sysv_args=None): | |||
handle_collect_logs_args, | |||
) | |||
|
|||
logs_parser(parser_collect_logs) | |||
logs_parser(parser=parser_collect_logs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intended to be in the cleanup commit?
@@ -293,7 +298,11 @@ def collect_logs(tarfile, include_userdata: bool, verbosity=0): | |||
|
|||
def handle_collect_logs_args(name, args): | |||
"""Handle calls to 'cloud-init collect-logs' as a subcommand.""" | |||
return collect_logs(args.tarfile, args.userdata, args.verbosity) | |||
return collect_logs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intended to be in the cleanup commit?
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.) |
54d9c49
to
d7d5d6c
Compare
d7d5d6c
to
7fdc133
Compare
I had to rebase because local linting was acting weird, so the most recent changes might not be obvious. I'll explain them here. For your two comments of Beyond those two, the other change was the test_logs.py change of moving the I also amended the commit message of both commits to include the PR number here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would use fix
rather than refactor
for the first commit, since it makes functional changes which resolve undesirable behavior. Otherwise this looks good to me!
7fdc133
to
6ebe98e
Compare
Proposed Commit Message
Additional Context
tests/unittests/cmd/devel/test_logs.py
would fail if you ran the file on its own due to subp happening on import.The 2nd commit is just some extra cleanup.
Merge type