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…
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
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)- A74% (29)
- B8% (3)
- C3% (1)
- D15% (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
Community Discussion
No community discussion yet for this question.
