Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nabu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Vincent
Nabu
Commits
a3962d44
Commit
a3962d44
authored
3 years ago
by
Pierre Paleo
Browse files
Options
Downloads
Patches
Plain Diff
Rename 'default_nabu_config' to 'default_config'
parent
ad8869de
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nabu/pipeline/config.py
+9
-9
9 additions, 9 deletions
nabu/pipeline/config.py
with
9 additions
and
9 deletions
nabu/pipeline/config.py
+
9
−
9
View file @
a3962d44
...
@@ -176,7 +176,7 @@ def _handle_modified_key(key, val, section, default_config, renamed_keys):
...
@@ -176,7 +176,7 @@ def _handle_modified_key(key, val, section, default_config, renamed_keys):
return
key
,
None
,
section
# unhandled renamed/deleted key
return
key
,
None
,
section
# unhandled renamed/deleted key
def
validate_config
(
config
,
default_
nabu_
config
,
renamed_keys
,
errors
=
"
warn
"
):
def
validate_config
(
config
,
default_config
,
renamed_keys
,
errors
=
"
warn
"
):
"""
"""
Validate a configuration dictionary against a
"
default
"
configuration dict.
Validate a configuration dictionary against a
"
default
"
configuration dict.
...
@@ -204,28 +204,28 @@ def validate_config(config, default_nabu_config, renamed_keys, errors="warn"):
...
@@ -204,28 +204,28 @@ def validate_config(config, default_nabu_config, renamed_keys, errors="warn"):
# Ignore the "other" section
# Ignore the "other" section
if
section
.
lower
()
==
"
other
"
:
if
section
.
lower
()
==
"
other
"
:
continue
continue
if
section
not
in
default_
nabu_
config
:
if
section
not
in
default_config
:
error
(
"
Unknown section [%s]
"
%
section
)
error
(
"
Unknown section [%s]
"
%
section
)
continue
continue
res_config
[
section
]
=
_extract_nabuconfig_section
(
section
,
default_
nabu_
config
)
res_config
[
section
]
=
_extract_nabuconfig_section
(
section
,
default_config
)
res_config
[
section
].
update
(
section_content
)
res_config
[
section
].
update
(
section_content
)
for
key
,
value
in
res_config
[
section
].
items
():
for
key
,
value
in
res_config
[
section
].
items
():
opt
=
default_
nabu_
config
[
section
].
get
(
key
,
None
)
opt
=
default_config
[
section
].
get
(
key
,
None
)
key
,
opt
,
section_updated
=
_handle_modified_key
(
key
,
opt
,
section
,
default_
nabu_
config
,
renamed_keys
)
key
,
opt
,
section_updated
=
_handle_modified_key
(
key
,
opt
,
section
,
default_config
,
renamed_keys
)
if
key
is
None
:
if
key
is
None
:
continue
# deleted key
continue
# deleted key
if
opt
is
None
:
if
opt
is
None
:
error
(
"
Unknown option
'
%s
'
in section [%s]
"
%
(
key
,
section_updated
))
error
(
"
Unknown option
'
%s
'
in section [%s]
"
%
(
key
,
section_updated
))
continue
continue
validator
=
default_
nabu_
config
[
section_updated
][
key
][
"
validator
"
]
validator
=
default_config
[
section_updated
][
key
][
"
validator
"
]
if
section_updated
not
in
res_config
:
# missing section - handled later
if
section_updated
not
in
res_config
:
# missing section - handled later
continue
continue
res_config
[
section_updated
][
key
]
=
validator
(
section_updated
,
key
,
value
)
res_config
[
section_updated
][
key
]
=
validator
(
section_updated
,
key
,
value
)
# Handle sections missing in config
# Handle sections missing in config
for
section
in
(
set
(
default_
nabu_
config
.
keys
())
-
set
(
res_config
.
keys
())):
for
section
in
(
set
(
default_config
.
keys
())
-
set
(
res_config
.
keys
())):
res_config
[
section
]
=
_extract_nabuconfig_section
(
section
,
default_
nabu_
config
)
res_config
[
section
]
=
_extract_nabuconfig_section
(
section
,
default_config
)
for
key
,
value
in
res_config
[
section
].
items
():
for
key
,
value
in
res_config
[
section
].
items
():
validator
=
default_
nabu_
config
[
section
][
key
][
"
validator
"
]
validator
=
default_config
[
section
][
key
][
"
validator
"
]
res_config
[
section
][
key
]
=
validator
(
section
,
key
,
value
)
res_config
[
section
][
key
]
=
validator
(
section
,
key
,
value
)
return
res_config
return
res_config
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment