diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 58ef40b14..1c7a73041 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -1565,5 +1565,5 @@ void Application::ValidateName(const String& value, const ValidationUtils& utils ObjectImpl::ValidateName(value, utils); if (value != "app") - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("name"), "Application object must be named 'app'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "name" }, "Application object must be named 'app'.")); } diff --git a/lib/base/logger.cpp b/lib/base/logger.cpp index e05fdbb53..45cbfdf1c 100644 --- a/lib/base/logger.cpp +++ b/lib/base/logger.cpp @@ -220,6 +220,6 @@ void Logger::ValidateSeverity(const String& value, const ValidationUtils& utils) try { StringToSeverity(value); } catch (...) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("severity"), "Invalid severity specified: " + value)); + BOOST_THROW_EXCEPTION(ValidationError(this, { "severity" }, "Invalid severity specified: " + value)); } } diff --git a/lib/base/sysloglogger.cpp b/lib/base/sysloglogger.cpp index cbd4d5701..9d43f38b3 100644 --- a/lib/base/sysloglogger.cpp +++ b/lib/base/sysloglogger.cpp @@ -111,7 +111,7 @@ void SyslogLogger::ValidateFacility(const String& value, const ValidationUtils& try { Convert::ToLong(value); } catch (const std::exception&) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("facility"), "Invalid facility specified.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "facility" }, "Invalid facility specified.")); } } } diff --git a/lib/compat/compatlogger.cpp b/lib/compat/compatlogger.cpp index 67561327a..f39750095 100644 --- a/lib/compat/compatlogger.cpp +++ b/lib/compat/compatlogger.cpp @@ -604,6 +604,6 @@ void CompatLogger::ValidateRotationMethod(const String& value, const ValidationU if (value != "HOURLY" && value != "DAILY" && value != "WEEKLY" && value != "MONTHLY" && value != "NONE") { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("rotation_method"), "Rotation method '" + value + "' is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "rotation_method" }, "Rotation method '" + value + "' is invalid.")); } } diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp index a9b189ade..abd8006c9 100644 --- a/lib/db_ido/dbconnection.cpp +++ b/lib/db_ido/dbconnection.cpp @@ -449,7 +449,7 @@ void DbConnection::ValidateFailoverTimeout(double value, const ValidationUtils& ObjectImpl::ValidateFailoverTimeout(value, utils); if (value < 60) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("failover_timeout"), "Failover timeout minimum is 60s.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "failover_timeout" }, "Failover timeout minimum is 60s.")); } void DbConnection::ValidateCategories(const Array::Ptr& value, const ValidationUtils& utils) @@ -462,7 +462,7 @@ void DbConnection::ValidateCategories(const Array::Ptr& value, const ValidationU DbCatAcknowledgement | DbCatComment | DbCatDowntime | DbCatEventHandler | DbCatExternalCommand | DbCatFlapping | DbCatLog | DbCatNotification | DbCatProgramStatus | DbCatRetention | DbCatStateHistory)) != 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("categories"), "categories filter is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "categories" }, "categories filter is invalid.")); } void DbConnection::IncreaseQueryCount(void) diff --git a/lib/icinga/checkable.cpp b/lib/icinga/checkable.cpp index 86cea0fc0..b43be68d0 100644 --- a/lib/icinga/checkable.cpp +++ b/lib/icinga/checkable.cpp @@ -64,7 +64,7 @@ void Checkable::OnAllConfigLoaded(void) Zone::Ptr cmdZone = endpoint->GetZone(); if (checkableZone && cmdZone != checkableZone && cmdZone->GetParent() != checkableZone) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("command_endpoint"), + BOOST_THROW_EXCEPTION(ValidationError(this, { "command_endpoint" }, "Command endpoint must be in zone '" + checkableZone->GetName() + "' or in a direct child zone thereof.")); } } @@ -193,7 +193,7 @@ void Checkable::ValidateCheckInterval(double value, const ValidationUtils& utils ObjectImpl::ValidateCheckInterval(value, utils); if (value <= 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("check_interval"), "Interval must be greater than 0.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "check_interval" }, "Interval must be greater than 0.")); } void Checkable::ValidateMaxCheckAttempts(int value, const ValidationUtils& utils) @@ -201,5 +201,5 @@ void Checkable::ValidateMaxCheckAttempts(int value, const ValidationUtils& utils ObjectImpl::ValidateMaxCheckAttempts(value, utils); if (value <= 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("max_check_attempts"), "Value must be greater than 0.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "max_check_attempts" }, "Value must be greater than 0.")); } diff --git a/lib/icinga/command.cpp b/lib/icinga/command.cpp index a127f92c6..8d8c936bc 100644 --- a/lib/icinga/command.cpp +++ b/lib/icinga/command.cpp @@ -38,7 +38,7 @@ void Command::Validate(int types, const ValidationUtils& utils) if (arguments) { if (!GetCommandLine().IsObjectType()) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("command"), "Attribute 'command' must be an array if the 'arguments' attribute is set.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "command" }, "Attribute 'command' must be an array if the 'arguments' attribute is set.")); ObjectLock olock(arguments); for (const Dictionary::Pair& kv : arguments) { @@ -52,18 +52,18 @@ void Command::Validate(int types, const ValidationUtils& utils) Value argvalue = argdict->Get("value"); if (argvalue.IsString() && !MacroProcessor::ValidateMacroString(argvalue)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("arguments")(kv.first)("value"), "Validation failed: Closing $ not found in macro format string '" + argvalue + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "arguments", kv.first, "value" }, "Validation failed: Closing $ not found in macro format string '" + argvalue + "'.")); } if (argdict->Contains("set_if")) { Value argsetif = argdict->Get("set_if"); if (argsetif.IsString() && !MacroProcessor::ValidateMacroString(argsetif)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("arguments")(kv.first)("set_if"), "Closing $ not found in macro format string '" + argsetif + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "arguments", kv.first, "set_if" }, "Closing $ not found in macro format string '" + argsetif + "'.")); } } else if (arginfo.IsString()) { if (!MacroProcessor::ValidateMacroString(arginfo)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("arguments")(kv.first), "Closing $ not found in macro format string '" + arginfo + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "arguments", kv.first }, "Closing $ not found in macro format string '" + arginfo + "'.")); } } } @@ -79,7 +79,7 @@ void Command::Validate(int types, const ValidationUtils& utils) continue; if (!MacroProcessor::ValidateMacroString(envval)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("env")(kv.first), "Closing $ not found in macro format string '" + envval + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "env", kv.first }, "Closing $ not found in macro format string '" + envval + "'.")); } } } diff --git a/lib/icinga/dependency.cpp b/lib/icinga/dependency.cpp index 601374a05..8aec486d2 100644 --- a/lib/icinga/dependency.cpp +++ b/lib/icinga/dependency.cpp @@ -216,9 +216,9 @@ void Dependency::ValidateStates(const Array::Ptr& value, const ValidationUtils& int sfilter = FilterArrayToInt(value, Notification::GetStateFilterMap(), 0); if (GetParentServiceName().IsEmpty() && (sfilter & ~(StateFilterUp | StateFilterDown)) != 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("states"), "State filter is invalid for host dependency.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid for host dependency.")); if (!GetParentServiceName().IsEmpty() && (sfilter & ~(StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("states"), "State filter is invalid for service dependency.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid for service dependency.")); } diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index 6a873d3f8..2b5c325d7 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -414,7 +414,7 @@ void Downtime::ValidateStartTime(const Timestamp& value, const ValidationUtils& ObjectImpl::ValidateStartTime(value, utils); if (value <= 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("start_time"), "Start time must be greater than 0.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "start_time" }, "Start time must be greater than 0.")); } void Downtime::ValidateEndTime(const Timestamp& value, const ValidationUtils& utils) @@ -422,5 +422,5 @@ void Downtime::ValidateEndTime(const Timestamp& value, const ValidationUtils& ut ObjectImpl::ValidateEndTime(value, utils); if (value <= 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("end_time"), "End time must be greater than 0.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "end_time" }, "End time must be greater than 0.")); } diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp index fb9f918f3..570912280 100644 --- a/lib/icinga/macroprocessor.cpp +++ b/lib/icinga/macroprocessor.cpp @@ -28,7 +28,6 @@ #include "base/scriptframe.hpp" #include "base/convert.hpp" #include "base/exception.hpp" -#include #include #include #include @@ -375,7 +374,7 @@ void MacroProcessor::ValidateCustomVars(const ConfigObject::Ptr& object, const D continue; if (!ValidateMacroString(kv_var.second)) - BOOST_THROW_EXCEPTION(ValidationError(object.get(), boost::assign::list_of("vars")(kv.first)(kv_var.first), "Closing $ not found in macro format string '" + kv_var.second + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(object.get(), { "vars", kv.first, kv_var.first }, "Closing $ not found in macro format string '" + kv_var.second + "'.")); } } else if (varval.IsObjectType()) { /* check all array entries */ @@ -387,7 +386,7 @@ void MacroProcessor::ValidateCustomVars(const ConfigObject::Ptr& object, const D continue; if (!ValidateMacroString(arrval)) { - BOOST_THROW_EXCEPTION(ValidationError(object.get(), boost::assign::list_of("vars")(kv.first), "Closing $ not found in macro format string '" + arrval + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(object.get(), { "vars", kv.first }, "Closing $ not found in macro format string '" + arrval + "'.")); } } } else { @@ -395,7 +394,7 @@ void MacroProcessor::ValidateCustomVars(const ConfigObject::Ptr& object, const D continue; if (!ValidateMacroString(varval)) - BOOST_THROW_EXCEPTION(ValidationError(object.get(), boost::assign::list_of("vars")(kv.first), "Closing $ not found in macro format string '" + varval + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(object.get(), { "vars", kv.first }, "Closing $ not found in macro format string '" + varval + "'.")); } } } diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index fccd2cb9f..8f8b412d2 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -649,10 +649,10 @@ void Notification::ValidateStates(const Array::Ptr& value, const ValidationUtils int filter = FilterArrayToInt(value, GetStateFilterMap(), 0); if (GetServiceName().IsEmpty() && (filter == -1 || (filter & ~(StateFilterUp | StateFilterDown)) != 0)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("states"), "State filter is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid.")); if (!GetServiceName().IsEmpty() && (filter == -1 || (filter & ~(StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("states"), "State filter is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid.")); } void Notification::ValidateTypes(const Array::Ptr& value, const ValidationUtils& utils) @@ -664,7 +664,7 @@ void Notification::ValidateTypes(const Array::Ptr& value, const ValidationUtils& if (filter == -1 || (filter & ~(NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved | NotificationCustom | NotificationAcknowledgement | NotificationProblem | NotificationRecovery | NotificationFlappingStart | NotificationFlappingEnd)) != 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("types"), "Type filter is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "types" }, "Type filter is invalid.")); } Endpoint::Ptr Notification::GetCommandEndpoint(void) const diff --git a/lib/icinga/scheduleddowntime.cpp b/lib/icinga/scheduleddowntime.cpp index 305ab77b0..d3981fcb2 100644 --- a/lib/icinga/scheduleddowntime.cpp +++ b/lib/icinga/scheduleddowntime.cpp @@ -215,13 +215,13 @@ void ScheduledDowntime::ValidateRanges(const Dictionary::Ptr& value, const Valid int stride; LegacyTimePeriod::ParseTimeRange(kv.first, &begin_tm, &end_tm, &stride, &reference); } catch (const std::exception& ex) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("ranges"), "Invalid time specification '" + kv.first + "': " + ex.what())); + BOOST_THROW_EXCEPTION(ValidationError(this, { "ranges" }, "Invalid time specification '" + kv.first + "': " + ex.what())); } try { LegacyTimePeriod::ProcessTimeRanges(kv.second, &reference, segments); } catch (const std::exception& ex) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("ranges"), "Invalid time range definition '" + kv.second + "': " + ex.what())); + BOOST_THROW_EXCEPTION(ValidationError(this, { "ranges" }, "Invalid time range definition '" + kv.second + "': " + ex.what())); } } } diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index ffb7fe864..eed767c45 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -398,13 +398,13 @@ void TimePeriod::ValidateRanges(const Dictionary::Ptr& value, const ValidationUt int stride; LegacyTimePeriod::ParseTimeRange(kv.first, &begin_tm, &end_tm, &stride, &reference); } catch (const std::exception& ex) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("ranges"), "Invalid time specification '" + kv.first + "': " + ex.what())); + BOOST_THROW_EXCEPTION(ValidationError(this, { "ranges" }, "Invalid time specification '" + kv.first + "': " + ex.what())); } try { LegacyTimePeriod::ProcessTimeRanges(kv.second, &reference, segments); } catch (const std::exception& ex) { - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("ranges"), "Invalid time range definition '" + kv.second + "': " + ex.what())); + BOOST_THROW_EXCEPTION(ValidationError(this, { "ranges" }, "Invalid time range definition '" + kv.second + "': " + ex.what())); } } } diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index ce586da58..3344226b3 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -104,7 +104,7 @@ void User::ValidateStates(const Array::Ptr& value, const ValidationUtils& utils) int filter = FilterArrayToInt(value, Notification::GetStateFilterMap(), 0); if (filter == -1 || (filter & ~(StateFilterUp | StateFilterDown | StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("states"), "State filter is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid.")); } void User::ValidateTypes(const Array::Ptr& value, const ValidationUtils& utils) @@ -116,5 +116,5 @@ void User::ValidateTypes(const Array::Ptr& value, const ValidationUtils& utils) if (filter == -1 || (filter & ~(NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved | NotificationCustom | NotificationAcknowledgement | NotificationProblem | NotificationRecovery | NotificationFlappingStart | NotificationFlappingEnd)) != 0) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("types"), "Type filter is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "types" }, "Type filter is invalid.")); } diff --git a/lib/livestatus/livestatuslistener.cpp b/lib/livestatus/livestatuslistener.cpp index 3fc7391ed..9ed0c9b6e 100644 --- a/lib/livestatus/livestatuslistener.cpp +++ b/lib/livestatus/livestatuslistener.cpp @@ -225,5 +225,5 @@ void LivestatusListener::ValidateSocketType(const String& value, const Validatio ObjectImpl::ValidateSocketType(value, utils); if (value != "unix" && value != "tcp") - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("socket_type"), "Socket type '" + value + "' is invalid.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "socket_type" }, "Socket type '" + value + "' is invalid.")); } diff --git a/lib/perfdata/graphitewriter.cpp b/lib/perfdata/graphitewriter.cpp index b87104358..75ca4008b 100644 --- a/lib/perfdata/graphitewriter.cpp +++ b/lib/perfdata/graphitewriter.cpp @@ -350,7 +350,7 @@ void GraphiteWriter::ValidateHostNameTemplate(const String& value, const Validat ObjectImpl::ValidateHostNameTemplate(value, utils); if (!MacroProcessor::ValidateMacroString(value)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("host_name_template"), "Closing $ not found in macro format string '" + value + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "host_name_template" }, "Closing $ not found in macro format string '" + value + "'.")); } void GraphiteWriter::ValidateServiceNameTemplate(const String& value, const ValidationUtils& utils) @@ -358,5 +358,5 @@ void GraphiteWriter::ValidateServiceNameTemplate(const String& value, const Vali ObjectImpl::ValidateServiceNameTemplate(value, utils); if (!MacroProcessor::ValidateMacroString(value)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("service_name_template"), "Closing $ not found in macro format string '" + value + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "service_name_template" }, "Closing $ not found in macro format string '" + value + "'.")); } diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp index e9636645c..6bc9cd9bc 100644 --- a/lib/perfdata/influxdbwriter.cpp +++ b/lib/perfdata/influxdbwriter.cpp @@ -514,14 +514,14 @@ void InfluxdbWriter::ValidateHostTemplate(const Dictionary::Ptr& value, const Va String measurement = value->Get("measurement"); if (!MacroProcessor::ValidateMacroString(measurement)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("host_template")("measurement"), "Closing $ not found in macro format string '" + measurement + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "host_template", "measurement" }, "Closing $ not found in macro format string '" + measurement + "'.")); Dictionary::Ptr tags = value->Get("tags"); if (tags) { ObjectLock olock(tags); for (const Dictionary::Pair& pair : tags) { if (!MacroProcessor::ValidateMacroString(pair.second)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("host_template")("tags")(pair.first), "Closing $ not found in macro format string '" + pair.second)); + BOOST_THROW_EXCEPTION(ValidationError(this, { "host_template", "tags", pair.first }, "Closing $ not found in macro format string '" + pair.second)); } } } @@ -532,14 +532,14 @@ void InfluxdbWriter::ValidateServiceTemplate(const Dictionary::Ptr& value, const String measurement = value->Get("measurement"); if (!MacroProcessor::ValidateMacroString(measurement)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("service_template")("measurement"), "Closing $ not found in macro format string '" + measurement + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "service_template", "measurement" }, "Closing $ not found in macro format string '" + measurement + "'.")); Dictionary::Ptr tags = value->Get("tags"); if (tags) { ObjectLock olock(tags); for (const Dictionary::Pair& pair : tags) { if (!MacroProcessor::ValidateMacroString(pair.second)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("service_template")("tags")(pair.first), "Closing $ not found in macro format string '" + pair.second)); + BOOST_THROW_EXCEPTION(ValidationError(this, { "service_template", "tags", pair.first }, "Closing $ not found in macro format string '" + pair.second)); } } } diff --git a/lib/perfdata/perfdatawriter.cpp b/lib/perfdata/perfdatawriter.cpp index cb2da1150..1350edfea 100644 --- a/lib/perfdata/perfdatawriter.cpp +++ b/lib/perfdata/perfdatawriter.cpp @@ -163,7 +163,7 @@ void PerfdataWriter::ValidateHostFormatTemplate(const String& value, const Valid ObjectImpl::ValidateHostFormatTemplate(value, utils); if (!MacroProcessor::ValidateMacroString(value)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("host_format_template"), "Closing $ not found in macro format string '" + value + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "host_format_template" }, "Closing $ not found in macro format string '" + value + "'.")); } void PerfdataWriter::ValidateServiceFormatTemplate(const String& value, const ValidationUtils& utils) @@ -171,5 +171,5 @@ void PerfdataWriter::ValidateServiceFormatTemplate(const String& value, const Va ObjectImpl::ValidateServiceFormatTemplate(value, utils); if (!MacroProcessor::ValidateMacroString(value)) - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("service_format_template"), "Closing $ not found in macro format string '" + value + "'.")); + BOOST_THROW_EXCEPTION(ValidationError(this, { "service_format_template" }, "Closing $ not found in macro format string '" + value + "'.")); } diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 0cf810868..bb4bb7760 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -1413,7 +1413,7 @@ void ApiListener::ValidateTlsProtocolmin(const String& value, const ValidationUt message += ", '" SSL_TXT_TLSV1_1 "' or '" SSL_TXT_TLSV1_2 "'"; #endif /* SSL_TXT_TLSV1_1 */ - BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("tls_protocolmin"), message)); + BOOST_THROW_EXCEPTION(ValidationError(this, { "tls_protocolmin" }, message)); } } diff --git a/test/remote-url.cpp b/test/remote-url.cpp index fce18d7ed..95297b932 100644 --- a/test/remote-url.cpp +++ b/test/remote-url.cpp @@ -20,7 +20,6 @@ #include "base/array.hpp" #include "remote/url.hpp" #include -#include using namespace icinga; @@ -50,17 +49,16 @@ BOOST_AUTO_TEST_CASE(get_and_set) url->SetPassword("Seehofer"); url->SetHost("koenigreich.bayern"); url->SetPort("1918"); - std::vector p = boost::assign::list_of("path")("to")("münchen"); - url->SetPath(p); + url->SetPath({ "path", "to", "münchen" }); BOOST_CHECK(url->Format(false, true) == "ftp://Horst:Seehofer@koenigreich.bayern:1918/path/to/m%C3%BCnchen"); std::map > m; - std::vector v1 = boost::assign::list_of("hip")("hip")("hurra"); - std::vector v2 = boost::assign::list_of("äü^ä+#ül-"); - std::vector v3 = boost::assign::list_of("1")("2"); - m.insert(std::pair >("shout", v1)); - m.insert(std::pair >("sonderzeichen", v2)); + std::vector v1 { "hip", "hip", "hurra" }; + std::vector v2 { "äü^ä+#ül-" }; + std::vector v3 { "1", "2" }; + m.emplace("shout", v1); + m.emplace("sonderzeichen", v2); url->SetQuery(m); url->SetQueryElements("count", v3); url->AddQueryElement("count", "3");