X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=RO%2Fosm_ro%2Fwim%2Fpersistence.py;h=27a87c45b7bf07c57273ba93ebbb3297028c1f2b;hp=32a46b358a490df7c8ae2a212c6fc638cf286162;hb=bf1d0f10e219ae475213b947ce8c76c77c40c452;hpb=57dadcfd0fcf3c8e933602e2fb57f32658d9c845 diff --git a/RO/osm_ro/wim/persistence.py b/RO/osm_ro/wim/persistence.py index 32a46b35..27a87c45 100644 --- a/RO/osm_ro/wim/persistence.py +++ b/RO/osm_ro/wim/persistence.py @@ -40,6 +40,7 @@ No domain logic/architectural concern should be present in this file. """ import json import logging +import string from contextlib import contextmanager from hashlib import sha1 from itertools import groupby @@ -307,6 +308,11 @@ class WimPersistence(object): if "config" in wim_descriptor: wim_descriptor["config"] = _serialize(wim_descriptor["config"]) + url = wim_descriptor["wim_url"] + wim_descriptor["wim_url"] = url.strip(string.whitespace + "/") + # ^ This avoid the common problem caused by trailing spaces/slashes in + # the URL (due to CTRL+C/CTRL+V) + return self.db.new_row( "wims", wim_descriptor, add_uuid=True, confidential_data=True) @@ -864,10 +870,7 @@ def _preprocess_wim_account(wim_account): """ wim_account = preprocess_record(wim_account) - created = wim_account.get('created') - wim_account['created'] = ( - 'true' if created is True or created == 'true' else 'false') - + wim_account['sdn'] = False return wim_account