mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 04:34:43 +02:00
config: Don't throw exception when file pattern doesn't match any files.
This commit is contained in:
parent
519ce78727
commit
59d979c61e
@ -198,9 +198,9 @@ void ConfigCompiler::HandleFileInclude(const String& include, bool search,
|
|||||||
|
|
||||||
std::vector<ConfigItem::Ptr> items;
|
std::vector<ConfigItem::Ptr> items;
|
||||||
|
|
||||||
if (!Utility::Glob(includePath, boost::bind(&ConfigCompiler::CompileFile, _1))) {
|
if (!Utility::Glob(includePath, boost::bind(&ConfigCompiler::CompileFile, _1)) && includePath.FindFirstOf("*?") == String::NPos) {
|
||||||
std::ostringstream msgbuf;
|
std::ostringstream msgbuf;
|
||||||
msgbuf << "Include file '" + include + "' does not exist (or no files found for pattern): " << debuginfo;
|
msgbuf << "Include file '" + include + "' does not exist: " << debuginfo;
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
|
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user