Skip to content

Commit 88c708f

Browse files
rohiebEmantor
authored andcommitted
linux: make sure we're using a CommandProtocol
All other functions in this file already assert this, do it in the remaining ones too. Signed-off-by: Roland Hieber <[email protected]>
1 parent a675d1f commit 88c708f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

labgridhelper/linux.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def get_interface_ip(command, interface="eth0"):
152152
Returns:
153153
str: IPv4 address of the interface, None otherwise
154154
"""
155+
assert isinstance(command, CommandProtocol), "command must be a CommandProtocol"
156+
155157
try:
156158
ip_string = command.run_check("ip -o -4 addr show")
157159
except ExecutionError:
@@ -186,6 +188,8 @@ def get_hostname(command):
186188
Returns:
187189
str: hostname of the target, None otherwise
188190
"""
191+
assert isinstance(command, CommandProtocol), "command must be a CommandProtocol"
192+
189193
try:
190194
hostname_string = command.run_check("hostname")
191195
except ExecutionError:

0 commit comments

Comments
 (0)