JNCIA-DevOps Python And PyEZ Practice Question
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?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Using PyEZ Table and View abstractions
The XMLtoPy function from jnpr.junos.factory or standard table/view mappings helps convert XML to Python data structures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Using PyEZ Table and View abstractions
Why this is correct
Correct. PyEZ Table/View mapping structures automatically parse XML output into clean Python dictionaries and lists.
- ✗
dev.rpc.convert_to_dict()
Why it's wrong here
Incorrect. This method does not exist.
- ✗
json.loads(dev.rpc.get_interface_information())
Why it's wrong here
Incorrect. RPC output is XML, not JSON strings.
- ✗
etree.to_dict()
Why it's wrong here
Incorrect. lxml elements do not have a built-in to_dict method.
About these practice questions
This JNCIA-DevOps question is part of Courseiva's 307-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Juniper Networks exam blueprint
This JNCIA-DevOps practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JNCIA-DevOps exam.