"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/remote/configstageshandler.cpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

configstageshandler.cpp  (icinga2-2.11.5):configstageshandler.cpp  (icinga2-2.12.0)
skipping to change at line 115 skipping to change at line 115
String packageName = HttpUtility::GetLastParameter(params, "package"); String packageName = HttpUtility::GetLastParameter(params, "package");
if (!ConfigPackageUtility::ValidateName(packageName)) if (!ConfigPackageUtility::ValidateName(packageName))
return HttpUtility::SendJsonError(response, params, 400, "Invalid package name '" + packageName + "'."); return HttpUtility::SendJsonError(response, params, 400, "Invalid package name '" + packageName + "'.");
bool reload = true; bool reload = true;
if (params->Contains("reload")) if (params->Contains("reload"))
reload = HttpUtility::GetLastParameter(params, "reload"); reload = HttpUtility::GetLastParameter(params, "reload");
bool activate = true;
if (params->Contains("activate"))
activate = HttpUtility::GetLastParameter(params, "activate");
Dictionary::Ptr files = params->Get("files"); Dictionary::Ptr files = params->Get("files");
String stageName; String stageName;
try { try {
if (!files) if (!files)
BOOST_THROW_EXCEPTION(std::invalid_argument("Parameter 'f iles' must be specified.")); BOOST_THROW_EXCEPTION(std::invalid_argument("Parameter 'f iles' must be specified."));
if (reload && !activate)
BOOST_THROW_EXCEPTION(std::invalid_argument("Parameter 'r
eload' must be false when 'activate' is false."));
boost::mutex::scoped_lock lock(ConfigPackageUtility::GetStaticPac kageMutex()); boost::mutex::scoped_lock lock(ConfigPackageUtility::GetStaticPac kageMutex());
stageName = ConfigPackageUtility::CreateStage(packageName, files) ; stageName = ConfigPackageUtility::CreateStage(packageName, files) ;
/* validate the config. on success, activate stage and reload */ /* validate the config. on success, activate stage and reload */
ConfigPackageUtility::AsyncTryActivateStage(packageName, stageNam e, reload); ConfigPackageUtility::AsyncTryActivateStage(packageName, stageNam e, activate, reload);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
return HttpUtility::SendJsonError(response, params, 500, return HttpUtility::SendJsonError(response, params, 500,
"Stage creation failed.", "Stage creation failed.",
DiagnosticInformation(ex)); DiagnosticInformation(ex));
} }
String responseStatus = "Created stage. "; String responseStatus = "Created stage. ";
if (reload) if (reload)
responseStatus += "Reload triggered."; responseStatus += "Reload triggered.";
 End of changes. 3 change blocks. 
1 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)