-
Notifications
You must be signed in to change notification settings - Fork 184
Enhancement for set_remote_log function in migration base_step.py and… #6784
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,9 @@ def run_migration(self): | |
| "dest_uri": dest_uri, "options": options, "virsh_options": virsh_options, | ||
| "extra": extra, "action_during_mig": action_during_mig, "extra_args": extra_args} | ||
| migration_base.do_migration(**do_mig_param) | ||
| if self.params.get_boolean("set_remote_libvirtd_log"): | ||
| utils_sys.display_remote_log(self.params, self.test) | ||
|
|
||
|
|
||
| def run_migration_again(self): | ||
| """ | ||
|
|
@@ -384,14 +387,15 @@ def set_remote_log(self): | |
| Set remote libvirtd log file | ||
|
|
||
| """ | ||
| log_level = self.params.get("libvirtd_debug_level") | ||
| log_file = self.params.get("libvirtd_debug_file") | ||
| log_filters = self.params.get("libvirtd_debug_filters") | ||
| remote_file_type = self.params.get("remote_file_type") | ||
| server_ip = self.params.get("server_ip") | ||
| server_user = self.params.get("server_user") | ||
| server_pwd = self.params.get("server_pwd") | ||
| log_level = self.params.get("libvirtd_debug_level", "1") | ||
| log_file = self.params.get("libvirtd_debug_file", "/var/log/libvirt/virtqemud.log") | ||
| log_filters = self.params.get("libvirtd_debug_filters", "1:*") | ||
| remote_file_type = self.params.get("remote_file_type", "virtqemud") | ||
| server_ip = self.params.get("server_ip", self.params.get("migrate_dest_host)")) | ||
| server_user = self.params.get("server_user", "root") | ||
| server_pwd = self.params.get("server_pwd", self.params.get("migrate_dest_pwd")) | ||
|
|
||
| self.test.log.debug(f"Start setting {remote_file_type} log on remote host") | ||
|
Comment on lines
+390
to
+398
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the Line 394 has a mismatched quote/paren, which is a 🛠️ Proposed fix- server_ip = self.params.get("server_ip", self.params.get("migrate_dest_host)"))
- server_user = self.params.get("server_user", "root")
- server_pwd = self.params.get("server_pwd", self.params.get("migrate_dest_pwd"))
+ server_ip = self.params.get("server_ip", self.params.get("migrate_dest_host"))
+ server_user = self.params.get("server_user", "root")
+ server_pwd = self.params.get("server_pwd", self.params.get("migrate_dest_pwd"))
+ # Ensure downstream helpers that read params see the resolved defaults
+ self.params.update({
+ "server_ip": server_ip,
+ "server_user": server_user,
+ "server_pwd": server_pwd,
+ })🤖 Prompt for AI Agents |
||
| service_name = utils_libvirtd.Libvirtd(remote_file_type).service_name | ||
| file_path = utils_config.get_conf_obj(service_name).conf_path | ||
| self.test.log.debug("Config file path: %s" % file_path) | ||
|
|
@@ -405,6 +409,10 @@ def set_remote_log(self): | |
| username=server_user, | ||
| password=server_pwd) | ||
| utils_libvirtd.Libvirtd(remote_file_type, session=remote_runner.session).restart() | ||
| self.params.update({ | ||
| "remote_session": remote_runner.session | ||
| }) | ||
|
|
||
|
|
||
| def check_local_and_remote_log(self, local_str_in_log=True, remote_str_in_log=True): | ||
| """ | ||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 452
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 240
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 1701
🏁 Script executed:
# Also check imports at the top of the file head -30 provider/migration/base_steps.pyRepository: autotest/tp-libvirt
Length of output: 813
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 45
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 45
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 667
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 1515
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 50375
🏁 Script executed:
Repository: autotest/tp-libvirt
Length of output: 97
Remove the call to the revoked
display_remote_logfunction at line 191.The commit
7059b4f51explicitly revokedutils_sys.display_remote_log, yet line 191 still calls this non-existent function. This will cause anAttributeErrorat runtime. The enhancement introducedset_remote_log()as the replacement mechanism—if remote log display is needed, use that pattern instead or remove this call entirely.🤖 Prompt for AI Agents