[icinga-checkins] icinga.org: icinga2/mfriedrich/config: Don't link items after we' ve encountered a compiler error.

git at icinga.org git at icinga.org
Mon Apr 8 11:20:14 CEST 2013


Module: icinga2
Branch: mfriedrich/config
Commit: ada9f634dde52c9be8a71e881f561f031259f8c5
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=ada9f634dde52c9be8a71e881f561f031259f8c5

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Mon Apr  8 10:09:27 2013 +0200

Don't link items after we've encountered a compiler error.

Fixes #3930

---

 icinga-app/icinga.cpp                |    8 ++++----
 lib/config/configcompilercontext.cpp |    3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp
index 13488bd..236b16e 100644
--- a/icinga-app/icinga.cpp
+++ b/icinga-app/icinga.cpp
@@ -72,11 +72,11 @@ static bool LoadConfigFiles(bool validateOnly)
 		}
 	}
 
-	context.LinkItems();
-
-	/* Don't validate if we have already encountered at least one error. */
-	if (!hasError)
+	/* Don't link or validate if we have already encountered at least one error. */
+	if (!hasError) {
+		context.LinkItems();
 		context.ValidateItems();
+	}
 
 	hasError = false;
 
diff --git a/lib/config/configcompilercontext.cpp b/lib/config/configcompilercontext.cpp
index 0404f7c..a412943 100644
--- a/lib/config/configcompilercontext.cpp
+++ b/lib/config/configcompilercontext.cpp
@@ -34,6 +34,9 @@ ConfigCompilerContext::ConfigCompilerContext(void)
 
 void ConfigCompilerContext::AddItem(const ConfigItem::Ptr& item)
 {
+	Log(LogDebug, "config", "Adding item to compiler context: type=" +
+	    item->GetType() + "; name=" + item->GetName());
+
 	m_Items.push_back(item);
 	m_ItemsMap[std::make_pair(item->GetType(), item->GetName())] = item;
 }





More information about the icinga-checkins mailing list