diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-08 12:19:45 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-08 12:19:45 -0300 |
commit | 2bb9737ef4b17b363e95bd5221cbba34751c75bd (patch) | |
tree | 9ff6319a6acd8dddc6f112f037fb848e31afae9d /src/leap/services/soledad/soledadspec.py | |
parent | 17affdf90bb8d4f866128bacfb68e13877d4a2b7 (diff) | |
parent | 3d07947ebca6b9dc339fc040cc4498ee94b9a42c (diff) |
Merge remote-tracking branch 'ivan/feature/3404_multiple-schema-support-for-soledad' into develop
Diffstat (limited to 'src/leap/services/soledad/soledadspec.py')
-rw-r--r-- | src/leap/services/soledad/soledadspec.py | 21 |
1 files changed, 20 insertions, 1 deletions
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 |