Courseiva

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.

60 questions14 easy24 medium22 hard

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.

1

In a Jinja2 template designed for Junos configuration, how do you correctly output the value of a variable named 'hostname'?

Medium
2

Which PyEZ utility module should you import if you need to upgrade the Junos operating system on a remote device via a Python script?

Easy
3

Which TWO statements are true regarding PyEZ Table and View definitions? (Choose two)

Medium
4

You 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?

Hard
5

Which THREE advanced features or methods are available on a PyEZ Device instance for session management and inspection? (Choose three)

Hard
6

When 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?

Hard
7

What is JSNAPy primarily used for in Junos network automation?

Easy
8

What Jinja2 feature allows you to include the contents of another template file into your main configuration template?

Easy
9

An 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?

Medium
10

Which Jinja2 construct is used to define reusable blocks of template code that can be called with arguments like a function?

Easy
11

You 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?

Hard
12

You 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'?

Hard
13

When writing Jinja2 templates for Junos configurations, which THREE control flow or filtering constructs are valid? (Choose three)

Hard
14

Which TWO commands or tools are associated with running JSNAPy snapshot verifications from a CLI environment? (Choose two)

Medium
15

You 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?

Hard
16

When configuring a JSNAPy test file, which section defines the specific RPCs or CLI commands that should be executed to gather operational data?

Medium
17

When managing configuration changes via PyEZ Config utility, which context manager ensures that changes are automatically rolled back if an exception occurs within the block?

Easy
18

Which TWO actions can be performed using the JSNAPy command-line interface (CLI) tool during network verification workflows?

Medium
19

An 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?

Easy
20

When 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?

Hard
21

Which Python library does PyEZ depend on under the hood for managing secure SSH connections and NETCONF framing?

Easy
22

You 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?

Medium
23

What is the primary templating engine used alongside Python for generating structured Junos configuration text in network automation workflows?

Easy
24

An 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?

Medium
25

Which TWO methods are valid for loading configuration data into the PyEZ Config utility from different sources? (Choose two)

Medium
26

Which THREE exceptions can be raised by PyEZ during script execution when interacting with a Junos device? (Choose three)

Hard
27

When implementing Jinja2 templates for Junos configuration generation, which THREE features or syntax constructs are natively supported by the Jinja2 engine?

Hard
28

When configuring JSNAPy, which THREE components or sections are typically required within a YAML check/snapshot file? (Choose three)

Hard
29

You 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?

Medium
30

When 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...

Hard
31

Which TWO characteristics describe JSNAPy snapshot operations? (Choose two)

Medium
32

When working with the PyEZ Config utility, which THREE actions can be performed using the configuration context manager or its methods? (Choose three)

Hard
33

Which TWO of the following methods or attributes are valid ways to handle rollback operations or commit errors when using the PyEZ Config utility (cu)?

Hard
34

When using Jinja2 templates in Python to generate configurations, how can you load a template file from disk prior to rendering it with variables?

Medium
35

When 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?

Hard
36

You 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?

Medium
37

You want to run a JSNAPy verification test via Python code. Which Python class should you import and instantiate to execute the snapshot comparison programmatically?

Hard
38

When 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'?

Hard
39

In JSNAPy, what file format is used to define test cases and expected operational states?

Easy
40

You 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?

Hard
41

When 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?

Medium
42

An 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?

Easy
43

When writing a Python script using PyEZ, how should you handle connection timeout exceptions when attempting to connect to an unreachable Junos device?

Hard
44

When using Jinja2 inheritance, which tag is placed in a base template to indicate where child templates can insert their custom content?

Medium
45

Which TWO tasks are typically automated using Python and PyEZ in a network DevOps pipeline? (Choose two)

Medium
46

You 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?

Easy
47

You 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?

Medium
48

Which TWO methods or attributes are valid when using the PyEZ SW utility to manage Junos software? (Choose two)

Medium
49

You 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?

Medium
50

Which TWO of the following are valid ways to instantiate a PyEZ Device object in Python, providing connection parameters? (Choose two)

Medium
51

In 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?

Easy
52

What is the primary benefit of using PyEZ Table and View abstractions over raw RPC XML parsing in Python scripts?

Easy
53

You 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?

Hard
54

Which TWO benefits are gained by using Python virtual environments when developing PyEZ and Jinja2 automation scripts? (Choose two)

Medium
55

When developing Python scripts that utilize PyEZ and Jinja2, which THREE best practices ensure robust and maintainable automation code? (Choose three)

Hard
56

When executing an RPC call in PyEZ, what format is typically returned by default if you do not parse it into another structure?

Easy
57

When 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?

Hard
58

When 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?

Medium
59

You 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?

Medium
60

An 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?

Medium

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.
juniper-jncia-devops JUNIPER-JNCIA-DEVOPS python and pyez Practice Questions