Ubuntu Pastebin

Paste from csmith at Fri, 22 Sep 2017 19:40:48 +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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/cloudinit/config/cc_zypper_add_repo.py b/cloudinit/config/cc_zypper_add_repo.py
index f1be13d..590339e 100644
--- a/cloudinit/config/cc_zypper_add_repo.py
+++ b/cloudinit/config/cc_zypper_add_repo.py
@@ -10,6 +10,7 @@ import os
 import configobj
 import six
 
+from cloudinit.settings import PER_ALWAYS
 from cloudinit import log as logging
 from cloudinit import util
 from cloudinit.config.schema import (
@@ -54,6 +55,42 @@ schema = {
     """)],
     'frequency': PER_ALWAYS,
     'type': 'object',
+    "properties": {
+        "zypper": {
+            "type": "object",
+            'properties': {
+                'repos': {
+                    'type': 'array',
+                    'items': {
+                        'type': 'object',
+                        'properties': {
+                            'id': {
+                                'type': 'string',
+                                'description': dedent("""\
+                                    The unique id of the repo, used when writing
+                                    /etc/zypp/repos.d/<id>.repo.""")
+                            },
+                            'baseurl': {
+                                'type': 'string',
+                                'format': 'uri',   # built-in format type
+                                'description': 'The base repositoy URL'
+                            }
+                        },
+                        'required': ['id', 'baseurl'],
+                        'additionalProperties': True
+                    },
+                    'minItems': 1
+                },
+                'config': {
+                    'type': 'object',
+                    'description': 'Any supported zypo.conf key is written to /etc/zypp/zypp.conf'
+                }
+            },
+            'required': [],
+            'minProperties': 1,  # Either config or repo must be provided
+            'additionalProperties': False, # only repos and config allowed
+        }
+    }
 }
 
 __doc__ = get_schema_doc(schema)  # Supplement python help()
Download as text