Ubuntu Pastebin

Paste from smoser at Fri, 8 Sep 2017 17:04:18 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/cloudinit/config/cc_bootcmd.py b/cloudinit/config/cc_bootcmd.py
index fc787aa7..6a1352d6 100644
--- a/cloudinit/config/cc_bootcmd.py
+++ b/cloudinit/config/cc_bootcmd.py
@@ -12,7 +12,7 @@
 import os
 from textwrap import dedent
 
-from cloudinit.config.schema import validate_cloudconfig_schema
+from cloudinit.config.schema import validate_cloudconfig_schema, doc_from_schema
 from cloudinit.settings import PER_ALWAYS
 from cloudinit import util
 
@@ -66,6 +66,8 @@ schema = {
     }
 }
 
+__doc__ = doc_from_schema(schema)
+
 
 def handle(name, cfg, cloud, log, _args):
 
diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py
index 16a290e2..6c4da911 100644
--- a/cloudinit/config/schema.py
+++ b/cloudinit/config/schema.py
@@ -343,6 +343,11 @@ def handle_schema_args(name, args):
             print(get_schema_doc(subschema))
 
 
+def doc_from_schema(schema):
+    return '\n'.join([
+        schema['name'], "", schema['title'], "", schema['description'], ""])
+
+
 def main():
     """Tool to validate schema of a cloud-config file or print schema docs."""
     parser = get_parser()
Download as text