Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pyDTN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
space-public
pyDTN
Commits
b74488be
Commit
b74488be
authored
Aug 27, 2019
by
Juraj Sloboda
Committed by
Matej Feder
Sep 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle case when user config has value None
parent
4ef772f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
pydtn/pydtn/pydtn.py
pydtn/pydtn/pydtn.py
+4
-1
pydtn_rest/pydtn_rest/pydtn_rest.py
pydtn_rest/pydtn_rest/pydtn_rest.py
+4
-1
No files found.
pydtn/pydtn/pydtn.py
View file @
b74488be
...
...
@@ -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
}
...
...
pydtn_rest/pydtn_rest/pydtn_rest.py
View file @
b74488be
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment