diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
index a02b4bf1..25accc59 100644
--- a/cloudinit/config/cc_ntp.py
+++ b/cloudinit/config/cc_ntp.py
@@ -76,10 +76,10 @@ schema = {
``{0-3}.{distro}.pool.ntp.org``."""),
'distros': distros,
'examples': [
- {'ntp': {'pools': ['0.company.pool.ntp.org', '1.company.pool.ntp.org',
- 'ntp.myorg.org'],
- 'servers': ['my.ntp.server.local', 'ntp.ubuntu.com',
- '192.168.23.2']}}],
+ dedent("""\
+ ntp:
+ pools: ['0.int.pool.ntp.org', '1.int.pool.ntp.org', 'ntp.myorg.org']
+ servers: ['ntp.server.local', 'ntp.ubuntu.com', '192.168.23.2']""")],
'frequency': PER_INSTANCE,
'type': 'object',
'properties': {
diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py
index 16a290e2..44aeb7a6 100644
--- a/cloudinit/config/schema.py
+++ b/cloudinit/config/schema.py
@@ -14,6 +14,7 @@ import re
import sys
import yaml
+_YAML_MAP = {True: 'true', False: 'false', None: 'null'}
SCHEMA_UNDEFINED = b'UNDEFINED'
CLOUD_CONFIG_HEADER = b'#cloud-config'
SCHEMA_DOC_TMPL = """
@@ -213,8 +214,7 @@ def _get_property_type(property_dict):
"""Return a string representing a property type from a given jsonschema."""
property_type = property_dict.get('type', SCHEMA_UNDEFINED)
if property_type == SCHEMA_UNDEFINED and property_dict.get('enum'):
- yaml_string = yaml.dump(property_dict.get('enum')).strip()
- property_type = yaml_string[1:-1].replace(', ', '/')
+ property_type = [str(_YAML_MAP.get(k, k)) for k in property_dict['enum']]
if isinstance(property_type, list):
property_type = '/'.join(property_type)
items = property_dict.get('items', {})
@@ -257,7 +257,7 @@ def _get_schema_examples(schema, prefix=''):
if isinstance(example, str):
example_content = example
else:
- example_content = yaml.dump(example, default_flow_style=False)
+ example_content = '\n'.join([e + "\n" for e in example])
# Python2.6 is missing textwrapper.indent
lines = example_content.split('\n')
indented_lines = [' {0}'.format(line) for line in lines]