Courseiva

JNCIA-DevOps · topic practice

Python And PyEZ practice questions

This domain covers automating Junos devices with Python and the PyEZ library. Questions present short scripting scenarios: loading and committing configuration, handling exceptions, using the SW utility for image installs, and running JSNAPy checks. You must know the correct classes, methods, and parameters to accomplish each task programmatically.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Python And PyEZ

What the exam tests

What to know about Python And PyEZ

Be able to write PyEZ scripts that load, merge, and commit configuration, catch CommitError and read its message, install images with the SW utility, and invoke JSNAPy checks in code. Getting the exact method names and parameters right is essential.

Using Config and commit_check with load merge to apply candidate configuration via PyEZ

Retrieving device error text from CommitError and RpcError exception objects

Installing Junos images with the PyEZ SW utility and its reboot parameter

Running JSNAPy snapshot comparisons programmatically by importing and instantiating the appropriate class

Watch out for

Common Python And PyEZ exam traps

  • ▸Confusing load merge with load replace or load override, which changes how candidate configuration is combined
  • ▸Assuming commit failures raise a generic exception rather than CommitError with device message details
  • ▸Forgetting that the SW utility reboot behavior is controlled by a method parameter, not automatic

Practice set

Python And PyEZ questions

20 questions · select your answer, then reveal the explanation

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?

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

Question 3hardmultiple choice
Open the full VLAN trunking answer →

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

Question 4mediummultiple choice
Study the full Python automation breakdown →

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

Question 5mediummultiple choice
Study the full Python automation breakdown →

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?

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?

Question 7hardmultiple choice
Open the full BGP breakdown →

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?

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

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?

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?

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

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

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

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

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

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

Question 17mediummultiple choice
Study the full Python automation breakdown →

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?

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

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

Question 20mediummultiple choice
Study the full Python automation breakdown →

You are developing a PyEZ script that loads a configuration from a Jinja2 template and commits it. The template uses variables that must be provided. Which PyEZ method should you use to load the rendered configuration while also performing a syntax check before commit?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Python And PyEZ sessions

Start a Python And PyEZ only practice session

Every question in these sessions is drawn from the Python And PyEZ domain — nothing else.

Related practice questions

Related JNCIA-DevOps topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the JNCIA-DevOps exam test about Python And PyEZ?
Be able to write PyEZ scripts that load, merge, and commit configuration, catch CommitError and read its message, install images with the SW utility, and invoke JSNAPy checks in code. Getting the exact method names and parameters right is essential.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Python And PyEZ questions in a focused session?
Yes — the session launcher on this page draws every question from the Python And PyEZ domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other JNCIA-DevOps topics?
Use the topic links above to move to related areas, or go back to the JNCIA-DevOps question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the JNCIA-DevOps exam covers. They are not copied from any real exam or dump site.