X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO%2Fosm_ro%2Fwim%2Fpersistence.py;h=d395bfc74f336b533421a51398225a2a47dd9f5a;hb=refs%2Ftags%2Fv7.0.1;hp=f0f1ac338397583ef6e9a2023f962848779a2809;hpb=7d782eff123e5b44d41437377ccca66ad1e8b21b;p=osm%2FRO.git diff --git a/RO/osm_ro/wim/persistence.py b/RO/osm_ro/wim/persistence.py index f0f1ac33..d395bfc7 100644 --- a/RO/osm_ro/wim/persistence.py +++ b/RO/osm_ro/wim/persistence.py @@ -44,7 +44,7 @@ from contextlib import contextmanager from hashlib import sha1 from itertools import groupby from operator import itemgetter -from sys import exc_info +# from sys import exc_info # from time import time from uuid import uuid1 as generate_uuid @@ -362,6 +362,7 @@ class WimPersistence(object): def get_wim_accounts(self, **kwargs): """Retrieve all the accounts from the database""" kwargs.setdefault('postprocess', _postprocess_wim_account) + kwargs.setdefault('WHERE', {"sdn": "false"}) return self.query(FROM=_WIM_ACCOUNT_JOIN, **kwargs) def get_wim_account(self, uuid_or_name, **kwargs): @@ -523,7 +524,7 @@ class WimPersistence(object): self.logger.exception(old_exception) ex = InvalidParameters( "The mapping must contain the " - "'pop_switch_dpid', 'pop_switch_port', and " + "'device_id', 'device_interface_id', and " "wan_service_mapping_info: " "('wan_switch_dpid' and 'wan_switch_port') or " "'wan_service_endpoint_id}'") @@ -727,7 +728,7 @@ class WimPersistence(object): kwargs.setdefault('error_if_none', False) criteria_fields = ('uuid', 'instance_scenario_id', 'sce_net_id', - 'wim_id', 'wim_account_id') + 'wim_id', 'wim_account_id', 'sdn') criteria = remove_none_items(filter_dict_keys(kwargs, criteria_fields)) kwargs = filter_out_dict_keys(kwargs, criteria_fields) @@ -863,9 +864,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