Skip to content

Commit

Permalink
Fix init BaseConsoleConn got unexpected param console_device (#17170)
Browse files Browse the repository at this point in the history
what
[Fix] Fix init BaseConsoleConn got unexpected param console_device

why
The PR(#16686) introduce a param console_device but not remove before BaseConsoleConn passing to parent class.
failure example:

  File "/var/src/sonic-mgmt/tests/common/connections/console_host.py", line 47, in ConsoleHost
    return ConsoleTypeMapper[console_type](**params)
  File "/var/src/sonic-mgmt/tests/common/connections/ssh_console_conn.py", line 35, in __init__
    super(SSHConsoleConn, self).__init__(**kwargs)
  File "/var/src/sonic-mgmt/tests/common/connections/base_console_conn.py", line 51, in __init__
    super(BaseConsoleConn, self).__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'console_device'
how
Remove param console_device before BaseConsoleConn passing to parent class.

test
Verified recover_by_console.py since it used this class, and the script could be executed without init exception.

Signed-off-by: Chun'ang Li <[email protected]>
  • Loading branch information
lerry-lee authored Feb 28, 2025
1 parent d4dd8e8 commit 3e07b9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/common/connections/base_console_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, **kwargs):
key_to_rm = ['console_username', 'console_password',
'console_host', 'console_port',
'sonic_username', 'sonic_password',
'console_type']
'console_type', 'console_device']
for key in key_to_rm:
if key in kwargs:
del kwargs[key]
Expand Down

0 comments on commit 3e07b9e

Please sign in to comment.