mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 15:14:07 +02:00
parent
29ad90a469
commit
ab5a55d754
@ -350,10 +350,19 @@ bool RepositoryUtility::RemoveObjectInternal(const String& name, const String& t
|
|||||||
if (type == "Host") {
|
if (type == "Host") {
|
||||||
path = GetRepositoryObjectConfigPath(type, attrs) + "/" + name;
|
path = GetRepositoryObjectConfigPath(type, attrs) + "/" + name;
|
||||||
|
|
||||||
|
/* if path does not exist, this host does not have any services */
|
||||||
|
if (!Utility::PathExists(path)) {
|
||||||
|
Log(LogNotice, "cli")
|
||||||
|
<< type << " '" << name << "' does not have any services configured.";
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<String> files;
|
std::vector<String> files;
|
||||||
|
|
||||||
Utility::GlobRecursive(path, "*.conf",
|
Utility::GlobRecursive(path, "*.conf",
|
||||||
boost::bind(&RepositoryUtility::CollectObjects, _1, boost::ref(files)), GlobFile);
|
boost::bind(&RepositoryUtility::CollectObjects, _1, boost::ref(files)), GlobFile);
|
||||||
|
|
||||||
|
|
||||||
BOOST_FOREACH(const String& file, files) {
|
BOOST_FOREACH(const String& file, files) {
|
||||||
RemoveObjectFileInternal(file);
|
RemoveObjectFileInternal(file);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user