MCPcopy Create free account
hub / github.com/Icinga/icinga2 / DeleteStage

Method DeleteStage

lib/remote/configpackageutility.cpp:239–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void ConfigPackageUtility::DeleteStage(const String& packageName, const String& stageName)
240{
241 String path = GetPackageDir() + "/" + packageName + "/" + stageName;
242
243 if (!Utility::PathExists(path))
244 BOOST_THROW_EXCEPTION(std::invalid_argument("Stage does not exist."));
245
246 if (GetActiveStage(packageName) == stageName)
247 BOOST_THROW_EXCEPTION(std::invalid_argument("Active stage cannot be deleted."));
248
249 Utility::RemoveDirRecursive(path);
250}
251
252std::vector<String> ConfigPackageUtility::GetStages(const String& packageName)
253{

Callers

nothing calls this directly

Calls 1

PathExistsFunction · 0.85

Tested by

no test coverage detected