300-535 practice question 12 of 15

The Netmiko BaseConnection class contains a method called “send_config_set()”. Which two actions does this method perform on the device? (Choose two.)

Full set: 60 questions
Answer options
A: It takes a filename parameter that executes commands contained in that file on the device.
B: It requires the user to explicitly send configure terminal and exit commands to the device to enter and exit configuration mode.
C: It automatically enters and exits configuration mode on the device. Correct answer
D: It takes a Python iterable, such as a list of commands, and executes them in order on the device. Correct answer
E: It saves the running configuration to the startup configuration after executing the configuration commands on the device.
Correct Answer:
C. It automatically enters and exits configuration mode on the device.; D. It takes a Python iterable, such as a list of commands, and executes them in order on the device.
Explanation

The sendconfigset() method in Netmiko's BaseConnection class is a high-level function designed to simplify applying configuration changes to a network device. It accepts a Python iterable (such as a list or tuple) of configuration command strings and executes them sequentially. A key feature of this method is its automation of session management; it automatically handles entering the device's configuration mode before sending the commands and exiting configuration mode upon completion, abstracting this process from the user.

Why Incorrect

A. The method for sending commands from a file is sendconfigfromfile(), not sendconfigset().
B. This is incorrect because the primary purpose of sendconfigset() is to abstract away the need for manually entering and exiting configuration mode.
E. This method only modifies the running configuration. Saving the configuration is a separate, explicit action, typically performed using the saveconfig() method.

References

1. Official Netmiko Documentation (GitHub): The source code and docstrings for the BaseConnection class clearly define the sendconfigset method.

Source: netmiko/baseconnection.py

Reference: In the BaseConnection class, the method signature is def sendconfigset(self, configcommands=None, exitconfigmode=True, kwargs):. The docstring states: "Send configuration commands to device. The configcommands argument is a list of commands..." It also shows that the method handles entering and exiting configuration mode, with exitconfigmode controlling the exit behavior. This directly supports answers C and D. The existence of a separate sendconfigfromfile method in the same file invalidates option A. The lack of a "save" parameter or action in the method's code invalidates option E.

Link: https://github.com/ktbyers/netmiko/blob/develop/netmiko/baseconnection.py (Refer to the sendconfigset method definition within the BaseConnection class).

Scroll to Top