Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ssh_config/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def remove_comment(line):
def get_attribute(line):
"""Get attribute from the line"""
delim = " "
if "=" in line:
if " " not in line and "=" in line:
delim = "="
try:
key, value = line.split(delim, 1)
Expand Down
1 change: 1 addition & 0 deletions tests/sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Host server1
ServerAliveInterval 200
Host *
ServerAliveInterval 40
SetEnv TERM=xterm-256color
Host server_cmd_1
HostName 203.0.113.76
Port 2202
Expand Down
8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,20 @@ def test_host_command(self):
def test_asdict(self):
configs = SSHConfig(sample)
expected = sorted([
{"Host": "*", "ServerAliveInterval": 40},
{"Host": "*", "ServerAliveInterval": 40, "SetEnv": "TERM=xterm-256color"},
{"Host": "server1", "HostName": "203.0.113.76", "ServerAliveInterval": 200},
{"Host": "server_cmd_1", "HostName": "203.0.113.76", "Port": 2202},
{"Host": "server_cmd_2",
{"Host": "server_cmd_2",
"HostName": "203.0.113.76",
"Port": 22,
"User": "user",
},
{"Host": "server_cmd_3",
{"Host": "server_cmd_3",
"HostName": "203.0.113.76",
"Port": 2202,
"User": "user",
},
{"Host": "host_1 host_2",
{"Host": "host_1 host_2",
"HostName": "%h.test.com",
"Port": 2202,
"User": "user",
Expand Down
Loading