summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-08-08 12:10:18 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-08-08 12:10:18 -0300
commit55f51fee46c6b6a9189161a9a5648410400772ad (patch)
treee37124ef856bba892548d7da75c5e30181d8e34d
parent77e5ed38b2bc90799d691f159ed815d78c648dec (diff)
Add multiple schema support for Soledad.
Also fix comment typo.
-rw-r--r--src/leap/services/mail/smtpspec.py2
-rw-r--r--src/leap/services/soledad/soledadspec.py21
2 files changed, 21 insertions, 2 deletions
diff --git a/src/leap/services/mail/smtpspec.py b/src/leap/services/mail/smtpspec.py
index 9fc1984a..ff9d1bf8 100644
--- a/src/leap/services/mail/smtpspec.py
+++ b/src/leap/services/mail/smtpspec.py
@@ -19,7 +19,7 @@
# To add a schema for a version you should follow the form:
# { '1': schema_v1, '2': schema_v2, ... etc }
# so for instance, to add the '2' version, you should do:
-# eipservice_config_spec['2'] = schema_v2
+# smtp_config_spec['2'] = schema_v2
smtp_config_spec = {}
smtp_config_spec['1'] = {
diff --git a/src/leap/services/soledad/soledadspec.py b/src/leap/services/soledad/soledadspec.py
index 8233d6a0..111175dd 100644
--- a/src/leap/services/soledad/soledadspec.py
+++ b/src/leap/services/soledad/soledadspec.py
@@ -15,7 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-soledad_config_spec = {
+# Schemas dict
+# To add a schema for a version you should follow the form:
+# { '1': schema_v1, '2': schema_v2, ... etc }
+# so for instance, to add the '2' version, you should do:
+# soledad_config_spec['2'] = schema_v2
+soledad_config_spec = {}
+
+soledad_config_spec['1'] = {
'description': 'sample soledad service config',
'type': 'object',
'properties': {
@@ -55,3 +62,15 @@ soledad_config_spec = {
}
}
}
+
+
+def get_schema(version):
+ """
+ Returns the schema corresponding to the version given.
+
+ :param version: the version of the schema to get.
+ :type version: str
+ :rtype: dict or None if the version is not supported.
+ """
+ schema = soledad_config_spec.get(version, None)
+ return schema