X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ricsdl-package%2Fricsdl%2Fsyncstorage.py;h=62e3a7f0f726bf964d6b6a091c61f63e44e6e94f;hb=e67b9abd75c6ebeda849e5e718a507de4027f65d;hp=b15365a168c93a7de203643ec25542b09905d24d;hpb=77c5b120496bdcb798d0e02b719c177e8f48d4e9;p=ric-plt%2Fsdlpy.git diff --git a/ricsdl-package/ricsdl/syncstorage.py b/ricsdl-package/ricsdl/syncstorage.py index b15365a..62e3a7f 100755 --- a/ricsdl-package/ricsdl/syncstorage.py +++ b/ricsdl-package/ricsdl/syncstorage.py @@ -1,5 +1,5 @@ # Copyright (c) 2019 AT&T Intellectual Property. -# Copyright (c) 2018-2019 Nokia. +# Copyright (c) 2018-2022 Nokia. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -119,6 +119,7 @@ class SyncStorage(SyncStorageAbc): """ def __init__(self, fake_db_backend=None) -> None: super().__init__() + self.__dbbackend = None self.__configuration = _Configuration(fake_db_backend) self.event_separator = self.__configuration.get_event_separator() self.__dbbackend = ricsdl.backend.get_backend_instance(self.__configuration) @@ -141,7 +142,8 @@ class SyncStorage(SyncStorageAbc): return False def close(self): - self.__dbbackend.close() + if self.__dbbackend: + self.__dbbackend.close() @func_arg_checker(SdlTypeError, 1, ns=str, data_map=dict) def set(self, ns: str, data_map: Dict[str, bytes]) -> None: