JNCIA-DevOps · domain
Python And PyEZ
Practise Juniper Networks Automation and DevOps, Associate (JNCIA-DevOps, JN0-224) (JNCIA-DevOps) Python And PyEZ practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.
Focused practice
Practice Python And PyEZ questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about Python And PyEZ
Python And PyEZ questions test whether you can apply the concept in context, not just recognise a definition.
How the topic appears in realistic exam-style scenarios.
Which detail in the question changes the correct answer.
How to eliminate plausible but wrong options.
How to connect the question back to the wider exam objective.
Watch out for
Common Python And PyEZ exam traps
- ▸Answering from memory before reading the full scenario.
- ▸Missing a constraint such as cost, availability, security, scope or command context.
- ▸Choosing a broad answer when the question asks for the most specific fix.
- ▸Ignoring why the wrong options are tempting.
Question index
All Python And PyEZ questions (60)
Click any question to see the full explanation, or start a practice session above.
In a Jinja2 template designed for Junos configuration, how do you correctly output the value of a variable named 'hostname'?
Medium2Which PyEZ utility module should you import if you need to upgrade the Junos operating system on a remote device via a Python script?
Easy3Which TWO statements are true regarding PyEZ Table and View definitions? (Choose two)
Medium4You 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?
Hard5Which THREE advanced features or methods are available on a PyEZ Device instance for session management and inspection? (Choose three)
Hard6When 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?
Hard7What is JSNAPy primarily used for in Junos network automation?
Easy8What Jinja2 feature allows you to include the contents of another template file into your main configuration template?
Easy9An 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?
Medium10Which Jinja2 construct is used to define reusable blocks of template code that can be called with arguments like a function?
Easy11You 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?
Hard12You 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'?
Hard13When writing Jinja2 templates for Junos configurations, which THREE control flow or filtering constructs are valid? (Choose three)
Hard14Which TWO commands or tools are associated with running JSNAPy snapshot verifications from a CLI environment? (Choose two)
Medium15You 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?
Hard16When configuring a JSNAPy test file, which section defines the specific RPCs or CLI commands that should be executed to gather operational data?
Medium17When managing configuration changes via PyEZ Config utility, which context manager ensures that changes are automatically rolled back if an exception occurs within the block?
Easy18Which TWO actions can be performed using the JSNAPy command-line interface (CLI) tool during network verification workflows?
Medium19An 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?
Easy20When 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?
Hard21Which Python library does PyEZ depend on under the hood for managing secure SSH connections and NETCONF framing?
Easy22You 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?
Medium23What is the primary templating engine used alongside Python for generating structured Junos configuration text in network automation workflows?
Easy24An 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?
Medium25Which TWO methods are valid for loading configuration data into the PyEZ Config utility from different sources? (Choose two)
Medium26Which THREE exceptions can be raised by PyEZ during script execution when interacting with a Junos device? (Choose three)
Hard27When implementing Jinja2 templates for Junos configuration generation, which THREE features or syntax constructs are natively supported by the Jinja2 engine?
Hard28When configuring JSNAPy, which THREE components or sections are typically required within a YAML check/snapshot file? (Choose three)
Hard29You 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?
Medium30When executing raw XML RPCs via PyEZ, which THREE approaches or parameters can be used to handle or inspect the response XML? (Choose two) -> Wait, let's make it THREE since the prompt requires HALF of multi-select to be 'Which THREE'. Let's verify prompt: 'HALF use 'Which TWO', HALF use 'Which THREE'.' Total multi-select = 6. 3 use TWO, 3 use THREE. Let's make this one THREE. Which THREE approaches...
Hard31Which TWO characteristics describe JSNAPy snapshot operations? (Choose two)
Medium32When working with the PyEZ Config utility, which THREE actions can be performed using the configuration context manager or its methods? (Choose three)
Hard33Which TWO of the following methods or attributes are valid ways to handle rollback operations or commit errors when using the PyEZ Config utility (cu)?
Hard34When using Jinja2 templates in Python to generate configurations, how can you load a template file from disk prior to rendering it with variables?
Medium35When 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?
Hard36You 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?
Medium37You want to run a JSNAPy verification test via Python code. Which Python class should you import and instantiate to execute the snapshot comparison programmatically?
Hard38When 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'?
Hard39In JSNAPy, what file format is used to define test cases and expected operational states?
Easy40You 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?
Hard41When 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?
Medium42An 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?
Easy43When writing a Python script using PyEZ, how should you handle connection timeout exceptions when attempting to connect to an unreachable Junos device?
Hard44When using Jinja2 inheritance, which tag is placed in a base template to indicate where child templates can insert their custom content?
Medium45Which TWO tasks are typically automated using Python and PyEZ in a network DevOps pipeline? (Choose two)
Medium46You 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?
Easy47You 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?
Medium48Which TWO methods or attributes are valid when using the PyEZ SW utility to manage Junos software? (Choose two)
Medium49You 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?
Medium50Which TWO of the following are valid ways to instantiate a PyEZ Device object in Python, providing connection parameters? (Choose two)
Medium51In 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?
Easy52What is the primary benefit of using PyEZ Table and View abstractions over raw RPC XML parsing in Python scripts?
Easy53You 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?
Hard54Which TWO benefits are gained by using Python virtual environments when developing PyEZ and Jinja2 automation scripts? (Choose two)
Medium55When developing Python scripts that utilize PyEZ and Jinja2, which THREE best practices ensure robust and maintainable automation code? (Choose three)
Hard56When executing an RPC call in PyEZ, what format is typically returned by default if you do not parse it into another structure?
Easy57When 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?
Hard58When 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?
Medium59You 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?
Medium60An 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?
MediumOther domains
All JNCIA-DevOps exam domains
Frequently asked questions
- What does the Python And PyEZ domain cover on the JNCIA-DevOps exam?
- Python And PyEZ questions test whether you can apply the concept in context, not just recognise a definition.
- How many questions are in this domain?
- This page lists all 60 Python And PyEZ questions in the JNCIA-DevOps question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only Python And PyEZ questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.