A junior engineer is scripting a refresh of 40 Catalyst 9300 switches and needs one Python program that prints show version output and then applies an interface description change on each device. Which Netmiko approach handles both the display and the configuration safely?
Select an answer to reveal the explanation.
Short Explanation
You can keep this refresh in one Netmiko program: use send_command to collect show version, then send_config_set to apply the interface description. That method handles configuration mode for you, while send_command_timing relies on timing and manual prompt handling for the configuration sequence.
Full Explanation
Use one Netmiko connection per switch, with send_command to run show version and return its output for printing, followed by send_config_set to apply the interface and description commands. send_config_set enters configuration mode and handles the configuration prompts, making this a clear workflow for the same change across 40 Catalyst 9300 devices. The approach using send_command_timing for the configuration sequence can send commands, but relies on timing and manual prompt handling instead of Netmiko’s configuration workflow, so it is less dependable for applying the change across many devices. The approach that uses send_config_set for the change and send_command for show version has the right method for each task, but performs them in the opposite order from the requested sequence. The Ansible playbook with ios_command and ios_config is a valid network-automation pattern, but it is not the requested single Python program using Netmiko. Exam caveat: send_config_set sends configuration commands but does not by itself prove that the intended change took effect or will persist after a reload. Practical check: capture and inspect the returned show version output, then verify the interface description with a follow-up show command and review any device-reported errors.