nerdexam
Cisco

350-601 · Question #657

Refer to the exhibit. An engineer must develop a Python script that generates an interface configuration JinJa template called port_config.j2 with values defined in a Python dictionary called…

The correct answer is A. com = nexus.send_config_from_file('file'). The script generates the configuration from the port_config.j2 template using the int_dict dictionary. The rendered configuration is written to a file named port.conf. To send the generated configuration to the Cisco Nexus switch using SSH, the file port.conf must be read and…

Automation

Question

Refer to the exhibit. An engineer must develop a Python script that generates an interface configuration JinJa template called port_config.j2 with values defined in a Python dictionary called int_dict. The generated output must be written to a file called port.conf in the same directory as the Python script. Which line must be added to complete the script and send the interface configuration generated to a Cisco Nexus switch using SSH?

Exhibit

350-601 question #657 exhibit

Options

  • Acom = nexus.send_config_from_file('file')
  • Bcom = nexus.send_config_from_file('port.conf')
  • Ccom = nexus.send_config_from_file('int_dict')
  • Dcom = nexus.send_config_from_file('commands')

How the community answered

(39 responses)
  • A
    74% (29)
  • B
    8% (3)
  • C
    3% (1)
  • D
    15% (6)

Explanation

The script generates the configuration from the port_config.j2 template using the int_dict dictionary. The rendered configuration is written to a file named port.conf. To send the generated configuration to the Cisco Nexus switch using SSH, the file port.conf must be read and passed to the send_config_from_file method of the ConnectHandler

Topics

#Python Scripting#Jinja2 Templating#Network Automation#Netmiko/SSH Configuration

Community Discussion

No community discussion yet for this question.

Full 350-601 Practice