Practice JNCIA-DevOps Python And PyEZ questions with full explanations on every answer.
Start practicing
Python And PyEZ — choose a session length
Free · No account required
Click any question to see the full explanation and answer options, or start a focused practice session above.
Which PyEZ utility module should you import if you need to upgrade the Junos operating system on a remote device via a Python script?
2When managing configuration changes via PyEZ Config utility, which context manager ensures that changes are automatically rolled back if an exception occurs within the block?
3You are using the PyEZ SW utility to install a new Junos image on a device. Which method parameter allows the script to automatically reboot the device after a successful installation?
4An engineer is applying a candidate configuration using PyEZ and needs to load it from an external text file named 'interfaces.conf'. Which Config method should be used?
5You need to execute a custom remote procedure call (RPC) in PyEZ to retrieve the Ethernet switching table. The tag in Junos XML API is get-ethernet-switching-table-information. How should you write this method call in Python?
6You are writing a Python script to gather operational state information from a Junos device using PyEZ. Which method should you call on an open Device instance to retrieve standard hardware and OS inventory facts into a dictionary?
7You are writing a script that uses PyEZ to load a partial configuration merge. By default, what configuration database mode does the Config utility lock and load into?
8An automation engineer is writing a Python script using Junos PyEZ to connect to a device. Which module and class must be imported to instantiate a device object representing the Junos target?
9When writing a Python script using PyEZ, how should you handle connection timeout exceptions when attempting to connect to an unreachable Junos device?
10What is the primary templating engine used alongside Python for generating structured Junos configuration text in network automation workflows?
11In a Jinja2 template designed for Junos configuration, how do you correctly output the value of a variable named 'hostname'?
12You are rendering a Jinja2 template in Python that includes a loop over a list of VLANs. Which Jinja2 block syntax correctly iterates over a list named 'vlan_list'?
13What is JSNAPy primarily used for in Junos network automation?
14You want to run a JSNAPy verification test via Python code. Which Python class should you import and instantiate to execute the snapshot comparison programmatically?
15When configuring a JSNAPy test file, which section defines the specific RPCs or CLI commands that should be executed to gather operational data?
16When executing an RPC call in PyEZ, what format is typically returned by default if you do not parse it into another structure?
17You need to write a Python script that extracts interface status from a Junos device using PyEZ and converts the XML output directly into a Python dictionary. Which utility or function can assist with this conversion?
18When designing a custom PyEZ Table and View mapping in Python, what configuration parameter in the YAML definition file specifies the RPC or CLI command executed to gather the raw data?
19You are writing a script that uses PyEZ to load a Junos configuration file, but you want to replace an entire hierarchy level (e.g., protocols bgp) rather than merging the changes. Which parameter should you pass to the load method?
20In a Python script utilizing PyEZ, what method must be called on the Device instance after all configuration and operational tasks are complete to properly terminate the NETCONF session?
21When using Jinja2 templates in Python to generate configurations, how can you load a template file from disk prior to rendering it with variables?
22An automation script needs to check if a Junos device supports a specific feature before executing an RPC. Which PyEZ property can be checked to inspect the software version loaded on the device?
23You are writing a script that performs multiple configuration changes inside a single PyEZ Config context. How can you verify that the candidate configuration has syntax errors before committing it?
24Which Python library does PyEZ depend on under the hood for managing secure SSH connections and NETCONF framing?
25What Jinja2 feature allows you to include the contents of another template file into your main configuration template?
26In JSNAPy, what file format is used to define test cases and expected operational states?
27Which Jinja2 construct is used to define reusable blocks of template code that can be called with arguments like a function?
28When writing a Python script that connects to multiple Junos devices concurrently using PyEZ, which Python module is commonly used to manage thread pooling and parallel execution?
29When executing a PyEZ RPC call that returns a large dataset (e.g., massive routing table), how can you handle the output efficiently without exhausting local memory?
30You have captured a baseline snapshot using JSNAPy and want to compare a newly taken snapshot against that baseline. Which JSNAPy command-line action executes this comparison?
31When using PyEZ to push a configuration, you want to log out all NETCONF XML traffic exchanged between the script and the Junos device for debugging purposes. How do you enable this logging in Python?
32When writing a Python script to interact with Junos devices, you want to ensure that password credentials are not hardcoded in the source code. What is a recommended best practice supported by PyEZ?
33You are building a custom PyEZ application and need to catch exceptions specific to configuration parsing failures returned by Junos. Which exception class should your script import?
34What is the primary benefit of using PyEZ Table and View abstractions over raw RPC XML parsing in Python scripts?
35When using Jinja2 inheritance, which tag is placed in a base template to indicate where child templates can insert their custom content?
36Which TWO characteristics describe JSNAPy snapshot operations? (Choose two)
37Which TWO of the following are valid ways to instantiate a PyEZ Device object in Python, providing connection parameters? (Choose two)
38When working with the PyEZ Config utility, which THREE actions can be performed using the configuration context manager or its methods? (Choose three)
39When writing Jinja2 templates for Junos configurations, which THREE control flow or filtering constructs are valid? (Choose three)
40Which TWO methods or attributes are valid when using the PyEZ SW utility to manage Junos software? (Choose two)
41Which TWO statements are true regarding PyEZ Table and View definitions? (Choose two)
42Which THREE exceptions can be raised by PyEZ during script execution when interacting with a Junos device? (Choose three)
43When configuring JSNAPy, which THREE components or sections are typically required within a YAML check/snapshot file? (Choose three)
44Which THREE advanced features or methods are available on a PyEZ Device instance for session management and inspection? (Choose three)
45Which TWO benefits are gained by using Python virtual environments when developing PyEZ and Jinja2 automation scripts? (Choose two)
46Which TWO tasks are typically automated using Python and PyEZ in a network DevOps pipeline? (Choose two)
47Which TWO methods are valid for loading configuration data into the PyEZ Config utility from different sources? (Choose two)
48Which TWO commands or tools are associated with running JSNAPy snapshot verifications from a CLI environment? (Choose two)
49When developing Python scripts that utilize PyEZ and Jinja2, which THREE best practices ensure robust and maintainable automation code? (Choose three)
50An automation engineer is writing a Python script using Juniper PyEZ to connect to a Junos device. Which context manager approach is best practice to ensure the Device session is properly closed even if an exception occurs?
51You need to retrieve operational data from a Junos device using a PyEZ RPC call that equates to the CLI command 'show system information'. Which Python statement correctly invokes this RPC?
52When modifying a Junos device configuration using the PyEZ Config table-driven or Context manager (with Config(dev) as cu:), what is the default behavior regarding locking the candidate configuration?
53You are writing a script that uses Jinja2 to dynamically render a Junos interface configuration. Which Python module and function are required to load a template from the local filesystem and render it with a dictionary of variables?
54An automation script needs to compare pre- and post-change states on a Junos device using JSNAPy (Junos Snapshot Administrator). Which configuration file format is used by JSNAPy to define snapshot checks and test assertions?
55When loading configuration changes via PyEZ using cu.load(format='xml', action='update'), what is the precise impact of the 'update' action compared to 'merge' or 'override'?
56You are utilizing PyEZ Table and View abstractions to parse interface statistics. Which base class must your custom Table class inherit from to map to Junos XML output?
57Which TWO of the following methods or attributes are valid ways to handle rollback operations or commit errors when using the PyEZ Config utility (cu)?
58When implementing Jinja2 templates for Junos configuration generation, which THREE features or syntax constructs are natively supported by the Jinja2 engine?
59Which TWO actions can be performed using the JSNAPy command-line interface (CLI) tool during network verification workflows?
The Python And PyEZ domain covers the key concepts tested in this area of the JNCIA-DevOps exam blueprint published by Juniper Networks. Courseiva provides free domain-focused practice, mock exams, missed-question review, and readiness tracking across all JNCIA-DevOps domains — no account required.
The Courseiva JNCIA-DevOps question bank contains 59 questions in the Python And PyEZ domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Python And PyEZ domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included