JNCIA-DevOps Practice Question: A network automation script is reading a YAML configuration file containing Junos device…
A network automation script is reading a YAML configuration file containing Junos device credentials. The script encounters an unhandled exception when attempting to load the file using PyYAML. Upon inspection, the error is caused by a tab character used for indentation instead of spaces. Which YAML specification rule does this violate?
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
✓
Tab characters are strictly forbidden for indentation in YAML.
YAML 1.2 specifications explicitly prohibit the use of the tab character for indentation. All indentation whitespace must consist exclusively of space characters to maintain hierarchy definition.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Tab characters are strictly forbidden for indentation in YAML.
Why this is correct
YAML's block structure relies on spaces for indentation; tab characters are explicitly prohibited as indentation whitespace, so PyYAML raises a scanner error when it encounters one. This directly satisfies the stem's constraint: the unhandled exception stems from a tab used instead of spaces, violating that specification rule.
- ✗
Comments must start with a double forward slash (//).
Why it's wrong here
YAML comments begin with a hash (#), not //, so this rule is irrelevant to tab indentation. It tempts because many languages, including JavaScript and C, use // for comments, but PyYAML rejects tabs because YAML forbids them as indentation characters.
- ✗
YAML files require all keys to be wrapped in double quotes.
Why it's wrong here
YAML forbids tab characters for indentation; only spaces are permitted, which is the rule actually breached here. Quoting keys is optional and unrelated to this error. Double quotes are needed only when a key contains special characters or would otherwise be parsed as another type.
- ✗
Top-level keys must start with a hyphen (-) character.
Why it's wrong here
Hyphens denote sequence entries in YAML, not top-level keys, so this rule does not govern indentation. It tempts because lists are common in Junos configuration files, but the parser error stems from tab characters, which YAML prohibits for indentation.
About these practice questions
This JNCIA-DevOps question is part of Courseiva's 273-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 →
You might also like
Similar JNCIA-DevOps questions
- An automation engineer writes a Python script that loads a YAML file containing Junos device connection parameters. The…
- Which TWO of the following are valid scalar values in a YAML document? (Choose two)
- Which of the following valid JSON values represents a boolean true state?
- An automation developer is examining a JSON response payload returned by a Juniper device via a REST API call. Which val…
- Which file extension is conventionally used for YAML data serialization files?
Written and reviewed by Johnson Ajibi, MSc IT Security
Security Systems Architect · 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.