Commit 32e422a9 authored by Francis Dupont's avatar Francis Dupont

[904-add-ability-to-force-a-cb-update-remotely] Used "on demand" instead of...

[904-add-ability-to-force-a-cb-update-remotely] Used "on demand" instead of pull at the exception of the command name
parent 0af2c4de
......@@ -19,7 +19,7 @@
"resp-syntax": [
"{",
" \"result\": 0,",
" \"text\": \"Server update successful.\"",
" \"text\": \"On demand configuration update successful.\"",
"}"
],
......
......@@ -564,12 +564,14 @@ ControlledDhcpv4Srv::commandConfigBackendPullHandler(const std::string&,
auto mode = CBControlDHCPv4::FetchMode::FETCH_UPDATE;
server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
} catch (const std::exception& ex) {
LOG_ERROR(dhcp4_logger, DHCP4_CB_PULL_FETCH_UPDATES_FAIL)
LOG_ERROR(dhcp4_logger, DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL)
.arg(ex.what());
return (createAnswer(CONTROL_RESULT_ERROR,
"Server update failed: " + string(ex.what())));
"On demand configuration update failed: " +
string(ex.what())));
}
return (createAnswer(CONTROL_RESULT_SUCCESS, "Server update successful."));
return (createAnswer(CONTROL_RESULT_SUCCESS,
"On demand configuration update successful."));
}
ConstElementPtr
......
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Sun Oct 27 2019 19:40
#include <cstddef>
#include <log/message_types.h>
......@@ -13,9 +13,9 @@ extern const isc::log::MessageID DHCP4_BUFFER_RECEIVED = "DHCP4_BUFFER_RECEIVED"
extern const isc::log::MessageID DHCP4_BUFFER_RECEIVE_FAIL = "DHCP4_BUFFER_RECEIVE_FAIL";
extern const isc::log::MessageID DHCP4_BUFFER_UNPACK = "DHCP4_BUFFER_UNPACK";
extern const isc::log::MessageID DHCP4_BUFFER_WAIT_SIGNAL = "DHCP4_BUFFER_WAIT_SIGNAL";
extern const isc::log::MessageID DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL = "DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
extern const isc::log::MessageID DHCP4_CB_PULL_FETCH_UPDATES_FAIL = "DHCP4_CB_PULL_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED = "DHCP4_CLASS_ASSIGNED";
extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED = "DHCP4_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED = "DHCP4_CLASS_UNDEFINED";
......@@ -151,9 +151,9 @@ const char* values[] = {
"DHCP4_BUFFER_RECEIVE_FAIL", "error on attempt to receive packet: %1",
"DHCP4_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
"DHCP4_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
"DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
"DHCP4_CB_PULL_FETCH_UPDATES_FAIL", "error on pull attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
"DHCP4_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP4_CLASS_UNDEFINED", "required class %1 has no definition",
......
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Sun Oct 27 2019 19:40
#ifndef DHCP4_MESSAGES_H
#define DHCP4_MESSAGES_H
......@@ -14,9 +14,9 @@ extern const isc::log::MessageID DHCP4_BUFFER_RECEIVED;
extern const isc::log::MessageID DHCP4_BUFFER_RECEIVE_FAIL;
extern const isc::log::MessageID DHCP4_BUFFER_UNPACK;
extern const isc::log::MessageID DHCP4_BUFFER_WAIT_SIGNAL;
extern const isc::log::MessageID DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
extern const isc::log::MessageID DHCP4_CB_PULL_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED;
extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED;
......
......@@ -60,9 +60,9 @@ The server will continue to operate but won't make any further attempts
to fetch configuration updates. The administrator must fix the configuration
in the database and reload (or restart) the server.
% DHCP4_CB_PULL_FETCH_UPDATES_FAIL error on pull attempt to fetch configuration updates from the configuration backend(s): %1
% DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL error on demand attempt to fetch configuration updates from the configuration backend(s): %1
This error message is issued when the server attempted to fetch
configuration updates from the database and this pull attempt failed.
configuration updates from the database and this on demand attempt failed.
The sole argument which is returned to the config-backend-pull command
caller too contains the reason for failure.
......
......@@ -564,12 +564,14 @@ ControlledDhcpv6Srv::commandConfigBackendPullHandler(const std::string&,
auto mode = CBControlDHCPv6::FetchMode::FETCH_UPDATE;
server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
} catch (const std::exception& ex) {
LOG_ERROR(dhcp6_logger, DHCP6_CB_PULL_FETCH_UPDATES_FAIL)
LOG_ERROR(dhcp6_logger, DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL)
.arg(ex.what());
return (createAnswer(CONTROL_RESULT_ERROR,
"Server update failed: " + string(ex.what())));
"On demand configuration update failed: " +
string(ex.what())));
}
return (createAnswer(CONTROL_RESULT_SUCCESS, "Server update successful."));
return (createAnswer(CONTROL_RESULT_SUCCESS,
"On demand configuration update successful."));
}
isc::data::ConstElementPtr
......
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Sun Oct 27 2019 19:41
#include <cstddef>
#include <log/message_types.h>
......@@ -14,9 +14,9 @@ extern const isc::log::MessageID DHCP6_ALREADY_RUNNING = "DHCP6_ALREADY_RUNNING"
extern const isc::log::MessageID DHCP6_BUFFER_RECEIVED = "DHCP6_BUFFER_RECEIVED";
extern const isc::log::MessageID DHCP6_BUFFER_UNPACK = "DHCP6_BUFFER_UNPACK";
extern const isc::log::MessageID DHCP6_BUFFER_WAIT_SIGNAL = "DHCP6_BUFFER_WAIT_SIGNAL";
extern const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL = "DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
extern const isc::log::MessageID DHCP6_CB_PULL_FETCH_UPDATES_FAIL = "DHCP6_CB_PULL_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED = "DHCP6_CLASS_ASSIGNED";
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED = "DHCP6_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED = "DHCP6_CLASS_UNDEFINED";
......@@ -158,9 +158,9 @@ const char* values[] = {
"DHCP6_BUFFER_RECEIVED", "received buffer from %1:%2 to %3:%4 over interface %5",
"DHCP6_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
"DHCP6_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
"DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
"DHCP6_CB_PULL_FETCH_UPDATES_FAIL", "error on pull attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
"DHCP6_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP6_CLASS_UNDEFINED", "required class %1 has no definition",
......
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Sun Oct 27 2019 19:41
#ifndef DHCP6_MESSAGES_H
#define DHCP6_MESSAGES_H
......@@ -15,9 +15,9 @@ extern const isc::log::MessageID DHCP6_ALREADY_RUNNING;
extern const isc::log::MessageID DHCP6_BUFFER_RECEIVED;
extern const isc::log::MessageID DHCP6_BUFFER_UNPACK;
extern const isc::log::MessageID DHCP6_BUFFER_WAIT_SIGNAL;
extern const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
extern const isc::log::MessageID DHCP6_CB_PULL_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED;
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED;
......
......@@ -67,9 +67,9 @@ The server will continue to operate but won't make any further attempts
to fetch configuration updates. The administrator must fix the configuration
in the database and reload (or restart) the server.
% DHCP6_CB_PULL_FETCH_UPDATES_FAIL error on pull attempt to fetch configuration updates from the configuration backend(s): %1
% DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL error on demand attempt to fetch configuration updates from the configuration backend(s): %1
This error message is issued when the server attempted to fetch
configuration updates from the database and this pull attempt failed.
configuration updates from the database and this on demand attempt failed.
The sole argument which is returned to the config-backend-pull command
caller too contains the reason for failure.
......
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