MCPcopy
hub / github.com/ktbyers/netmiko / command_echo_read

Method command_echo_read

netmiko/base_connection.py:1483–1496  ·  view source on GitHub ↗
(self, cmd: str, read_timeout: float)

Source from the content-addressed store, hash-verified

1481 return output
1482
1483 def command_echo_read(self, cmd: str, read_timeout: float) -> str:
1484 # Make sure you read until you detect the command echo (avoid getting out of sync)
1485 new_data = self.read_until_pattern(pattern=re.escape(cmd), read_timeout=read_timeout)
1486
1487 # There can be echoed prompts that haven't been cleared before the cmd echo
1488 # this can later mess up the trailing prompt pattern detection. Clear this out.
1489 lines = new_data.split(cmd)
1490 if len(lines) == 2:
1491 # lines[-1] should realistically just be the null string
1492 new_data = f"{cmd}{lines[-1]}"
1493 else:
1494 # cmd exists in the output multiple times? Just retain the original output
1495 pass
1496 return new_data
1497
1498 @select_cmd_verify
1499 def send_command_timing(

Callers 2

send_command_timingMethod · 0.95
send_commandMethod · 0.95

Calls 1

read_until_patternMethod · 0.95

Tested by

no test coverage detected