Fix syntax and semantic errors in kdump remote feature #4114
+16
−43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4115
What I did
Fixed bugs in the upstream kdump remote SSH feature:
sedcommands to prevent unintended replacementsoptions.verbos→options.verbose--remoteflag to better reflect its functionalitywrite_ssh_path()sed command from/to|to handle paths correctlyHow I did it
1. Fixed sed regex patterns:
^anchor to sed patterns (s/#SSH/SSH/→s/^#SSH/SSH/) to ensure only lines starting with#SSHare matched, preventing false matches in comments or other parts of the configuration file2. Removed redundant SSH_KEY operations:
sedcommands for SSH_KEY in bothwrite_kdump_remote()andcmd_kdump_remote()functions3. Fixed typo:
options.verbostooptions.verbosein the main argument parsing section4. Simplified SSH path update:
cmd_kdump_ssh_path(). The function now always writes the path when provided, simplifying the logic5. Updated sed delimiter:
write_ssh_path()from/to|(s/#*SSH_KEY=.*/→s|#*SSH_KEY=.*|) to properly handle SSH key paths that may contain forward slashes6. Updated tests:
test_cmd_kdump_ssh_path_no_updatethat tested the removed comparison logicHow to verify it