Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
416
Issues
416
List
Boards
Labels
Service Desk
Milestones
Merge Requests
67
Merge Requests
67
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
bd5b17b5
Commit
bd5b17b5
authored
May 29, 2020
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#916
] Made the error fatal
parent
d7a926a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
src/lib/process/d_controller.cc
src/lib/process/d_controller.cc
+26
-7
src/lib/process/d_controller.h
src/lib/process/d_controller.h
+2
-1
No files found.
src/lib/process/d_controller.cc
View file @
bd5b17b5
...
...
@@ -200,11 +200,14 @@ DControllerBase::checkConfigOnly() {
}
if
(
module_config
->
getType
()
!=
Element
::
map
)
{
isc_throw
(
InvalidUsage
,
"Config file "
<<
config_file
<<
" include not map '"
<<
getAppName
()
<<
"' entry"
);
" include
s
not map '"
<<
getAppName
()
<<
"' entry"
);
}
// Handle other (i.e. not application name) objects.
handleOtherObjects
(
whole_config
);
std
::
string
errmsg
=
handleOtherObjects
(
whole_config
);
if
(
!
errmsg
.
empty
())
{
isc_throw
(
InvalidUsage
,
"Config file "
<<
config_file
<<
errmsg
);
}
// Get an application process object.
initProcess
();
...
...
@@ -373,11 +376,14 @@ DControllerBase::configFromFile() {
}
if
(
module_config
->
getType
()
!=
Element
::
map
)
{
isc_throw
(
InvalidUsage
,
"Config file "
<<
config_file
<<
" include not map '"
<<
getAppName
()
<<
"' entry"
);
" include
s
not map '"
<<
getAppName
()
<<
"' entry"
);
}
// Handle other (i.e. not application name) objects.
handleOtherObjects
(
whole_config
);
std
::
string
errmsg
=
handleOtherObjects
(
whole_config
);
if
(
!
errmsg
.
empty
())
{
isc_throw
(
InvalidUsage
,
"Config file "
<<
config_file
<<
errmsg
);
}
// Let's configure logging before applying the configuration,
// so we can log things during configuration process.
...
...
@@ -500,10 +506,11 @@ DControllerBase::configWriteHandler(const std::string&,
+
filename
+
" successful"
,
params
));
}
void
std
::
string
DControllerBase
::
handleOtherObjects
(
ConstElementPtr
args
)
{
// Check obsolete or unknown (aka unsupported) objects.
const
std
::
string
&
app_name
=
getAppName
();
std
::
string
errmsg
;
for
(
auto
obj
:
args
->
mapValue
())
{
const
std
::
string
&
obj_name
=
obj
.
first
;
if
(
obj_name
==
app_name
)
{
...
...
@@ -512,7 +519,13 @@ DControllerBase::handleOtherObjects(ConstElementPtr args) {
LOG_ERROR
(
dctl_logger
,
DCTL_CONFIG_DEPRECATED
)
.
arg
(
"'"
+
obj_name
+
"', defining anything in global level besides '"
+
app_name
+
"' is no longer supported."
);
if
(
errmsg
.
empty
())
{
errmsg
=
" contains unsupported '"
+
obj_name
+
"' parameter"
;
}
else
{
errmsg
+=
" (and '"
+
obj_name
+
"')"
;
}
}
return
(
errmsg
);
}
ConstElementPtr
...
...
@@ -535,6 +548,14 @@ DControllerBase::configTestHandler(const std::string&, ConstElementPtr args) {
}
}
if
(
message
.
empty
())
{
// Handle other (i.e. not application name) objects.
std
::
string
errmsg
=
handleOtherObjects
(
args
);
if
(
!
errmsg
.
empty
())
{
message
=
"'arguments' parameter"
+
errmsg
;
}
}
if
(
!
message
.
empty
())
{
// Something is amiss with arguments, return a failure response.
ConstElementPtr
result
=
isc
::
config
::
createAnswer
(
status_code
,
...
...
@@ -542,8 +563,6 @@ DControllerBase::configTestHandler(const std::string&, ConstElementPtr args) {
return
(
result
);
}
// Handle other (i.e. not application name) objects.
handleOtherObjects
(
args
);
// We are starting the configuration process so we should remove any
// staging configuration that has been created during previous
...
...
src/lib/process/d_controller.h
View file @
bd5b17b5
...
...
@@ -607,7 +607,8 @@ protected:
/// - check obsolete or unknown (aka unsupported) objects.
///
/// @param args Command arguments.
void
handleOtherObjects
(
isc
::
data
::
ConstElementPtr
args
);
/// @return Error message or empty string.
std
::
string
handleOtherObjects
(
isc
::
data
::
ConstElementPtr
args
);
private:
/// @brief Name of the service under control.
...
...
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