Commit b74488be authored by Juraj Sloboda's avatar Juraj Sloboda Committed by Matej Feder

Handle case when user config has value None

parent 4ef772f3
......@@ -11,11 +11,14 @@ from .bundle_protocol.bp_node import set_bp_node_id
logger = logging.getLogger(__name__)
def load_config(config):
def load_config(config=None):
filename = pkg_resources.resource_filename('pydtn', 'pydtn.yaml')
with open(filename, 'rt') as file:
default_config = yaml.safe_load(file.read())
if config is None:
return default_config
return {**default_config, **config}
......
......@@ -13,11 +13,14 @@ from pydtn.bundle_protocol.bp import NoContactError
logger = logging.getLogger(__name__)
def load_config(config):
def load_config(config=None):
filename = pkg_resources.resource_filename('pydtn_rest', 'pydtn_rest.yaml')
with open(filename, 'rt') as file:
default_config = yaml.safe_load(file.read())
if config is None:
return default_config
return {**default_config, **config}
......
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