Commit f2b87f20 authored by unknown's avatar unknown
Browse files

Add warning message when calling registry

parent 206f9a5d
"""Store settings""" """Store settings"""
import logging
from MaxIcsRegistry import MaxIcsRegistry from MaxIcsRegistry import MaxIcsRegistry
class Settings: class Settings:
...@@ -7,10 +7,12 @@ class Settings: ...@@ -7,10 +7,12 @@ class Settings:
"""Settings for BKC communication""" """Settings for BKC communication"""
def __init__(self, staging: bool = False, registry=None, **kwargs) -> None: def __init__(self, staging: bool = False, registry=None, **kwargs) -> None:
self.logger = logging.getLogger(self.__class__.__name__)
staging = kwargs.get("staging", False) staging = kwargs.get("staging", False)
registry = kwargs.get("registry") registry = kwargs.get("registry")
if not registry: if not registry:
self.logger.warning("Registry is not set when calling initializing Building. Calling registry...")
registry = MaxIcsRegistry.from_env(staging=staging) registry = MaxIcsRegistry.from_env(staging=staging)
building_center_info = registry.get_info("building-knowledge-information-center") building_center_info = registry.get_info("building-knowledge-information-center")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment