]> granicus.if.org Git - icinga2/commitdiff
config: Don't throw exception when file pattern doesn't match any files.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 30 Aug 2013 12:02:47 +0000 (14:02 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 30 Aug 2013 12:02:47 +0000 (14:02 +0200)
lib/config/configcompiler.cpp

index 33036b55e7b1d613f2329ad964a59e570b8d4528..42c2c5156011932a2e3837f952c357ead90e3a2f 100644 (file)
@@ -198,9 +198,9 @@ void ConfigCompiler::HandleFileInclude(const String& include, bool search,
 
        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;
-               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()));
        }
 }