Ubuntu Pastebin

Paste from smoser at Fri, 8 Sep 2017 17:23:00 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py
index 16a290e2..dda6987c 100644
--- a/cloudinit/config/schema.py
+++ b/cloudinit/config/schema.py
@@ -213,8 +213,8 @@ 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(', ', '/')
+        ymap = {True: 'true', False: 'false', None: 'null'}
+        property_type '/'.join(str(ymap.get(k, k)) for k in property_dict['enum'])
     if isinstance(property_type, list):
         property_type = '/'.join(property_type)
     items = property_dict.get('items', {})
Download as text