mirror of https://github.com/Icinga/icinga2.git
parent
29ad90a469
commit
ab5a55d754
|
@ -350,10 +350,19 @@ bool RepositoryUtility::RemoveObjectInternal(const String& name, const String& t
|
|||
if (type == "Host") {
|
||||
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;
|
||||
|
||||
Utility::GlobRecursive(path, "*.conf",
|
||||
boost::bind(&RepositoryUtility::CollectObjects, _1, boost::ref(files)), GlobFile);
|
||||
|
||||
|
||||
BOOST_FOREACH(const String& file, files) {
|
||||
RemoveObjectFileInternal(file);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue