Skip to content

Commit

Permalink
Revert "reverted ssh_key to ssh_string (sonic-net#216)"
Browse files Browse the repository at this point in the history
This reverts commit 7e1b280.
  • Loading branch information
muhammadalihussnain authored Feb 13, 2025
1 parent 7e1b280 commit 1aa6388
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions scripts/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ class KdumpCfg(object):
"memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M",
"num_dumps": "3",
"remote": "false", # New feature: remote, default is "false"
"ssh_string": "<user@server>", # New feature: SSH key, default value
"ssh_key": "<user@server>", # New feature: SSH key, default value
"ssh_path": "<path>" # New feature: SSH path, default value
}

Expand Down Expand Up @@ -1194,9 +1194,9 @@ class KdumpCfg(object):
remote = data.get("remote")
run_cmd(["sonic-kdump-config", "--remote", remote])

ssh_string = self.kdump_defaults["ssh_string"]
if data.get("ssh_string") is not None:
run_cmd(["sonic-kdump-config", "--ssh_string", ssh_string])
ssh_key = self.kdump_defaults["ssh_key"]
if data.get("ssh_key") is not None:
run_cmd(["sonic-kdump-config", "--ssh_key", ssh_key])
# ssh_path
ssh_path= self.kdump_defaults["ssh_path"]
if data.get("ssh_path") is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/hostcfgd/hostcfgd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test_kdump_event(self):
call(['sonic-kdump-config', '--num_dumps', '3']),
call(['sonic-kdump-config', '--memory', '0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M']),
call(['sonic-kdump-config', '--remote', 'false']), # Covering remote
call(['sonic-kdump-config', '--ssh_string', '<user@server>']), # Covering ssh_string
call(['sonic-kdump-config', '--ssh_key', '<user@server>']), # Covering ssh_key
call(['sonic-kdump-config', '--ssh_path', '<path>']) # Covering ssh_path
]
mocked_subprocess.check_call.assert_has_calls(expected, any_order=True)
Expand Down

0 comments on commit 1aa6388

Please sign in to comment.