[icinga-checkins] icinga.org: icinga2/master: Removed the old-style validation code.

git at icinga.org git at icinga.org
Sat Feb 2 20:03:28 CET 2013


Module: icinga2
Branch: master
Commit: b74c2c8a6878879df69b2973e33eeed2d660a4b9
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=b74c2c8a6878879df69b2973e33eeed2d660a4b9

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Feb  2 20:00:02 2013 +0100

Removed the old-style validation code.

---

 lib/base/dynamicobject.cpp       |    9 +--------
 lib/base/logger.cpp              |    8 +-------
 lib/icinga/host.cpp              |    6 ------
 lib/icinga/hostgroup.cpp         |    8 +-------
 lib/icinga/icingaapplication.cpp |   12 +-----------
 lib/icinga/service.cpp           |   11 -----------
 lib/icinga/servicegroup.cpp      |    8 +-------
 lib/icinga/timeperiod.cpp        |    1 -
 lib/remoting/endpoint.cpp        |    1 -
 9 files changed, 5 insertions(+), 59 deletions(-)

diff --git a/lib/base/dynamicobject.cpp b/lib/base/dynamicobject.cpp
index d850b10..9576de4 100644
--- a/lib/base/dynamicobject.cpp
+++ b/lib/base/dynamicobject.cpp
@@ -120,13 +120,6 @@ void DynamicObject::InternalApplyUpdate(const Dictionary::Ptr& serializedUpdate,
 		Value data = attr->Get("data");
 		double tx = attr->Get("tx");
 
-		if (!HasAttribute(it->first)) {
-			DynamicType::Ptr dtype = GetType();
-			if (dtype && !dtype->HasAttribute(it->first))
-				Logger::Write(LogWarning, "base", "Adding unknown attribute '" +
-				    it->first + "' to object '" + GetName() + "' of type '" + dtype->GetName() + "'");
-		}
-
 		if (type & Attribute_Config)
 			RegisterAttribute(it->first, Attribute_Config);
 
@@ -485,4 +478,4 @@ DynamicObject::Ptr DynamicObject::GetObject(const String& type, const String& na
 const DynamicObject::AttributeMap& DynamicObject::GetAttributes(void) const
 {
 	return m_Attributes;
-}
\ No newline at end of file
+}
diff --git a/lib/base/logger.cpp b/lib/base/logger.cpp
index c5e9635..86871cd 100644
--- a/lib/base/logger.cpp
+++ b/lib/base/logger.cpp
@@ -21,13 +21,7 @@
 
 using namespace icinga;
 
-static AttributeDescription loggerAttributes[] = {
-	{ "type", Attribute_Config },
-	{ "path", Attribute_Config },
-	{ "severity", Attribute_Config }
-};
-
-REGISTER_TYPE(Logger, loggerAttributes);
+REGISTER_TYPE(Logger, NULL);
 
 /**
  * Constructor for the Logger class.
diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp
index 8bf06eb..600e302 100644
--- a/lib/icinga/host.cpp
+++ b/lib/icinga/host.cpp
@@ -25,12 +25,6 @@ map<String, vector<Service::WeakPtr> > Host::m_ServicesCache;
 bool Host::m_ServicesCacheValid = true;
 
 static AttributeDescription hostAttributes[] = {
-	{ "alias", Attribute_Config },
-	{ "hostgroups", Attribute_Config },
-	{ "dependencies", Attribute_Config },
-	{ "hostchecks", Attribute_Config },
-	{ "macros", Attribute_Config },
-	{ "services", Attribute_Config },
 	{ "acknowledgement", Attribute_Replicated },
 	{ "acknowledgement_expiry", Attribute_Replicated },
 	{ "downtimes", Attribute_Replicated },
diff --git a/lib/icinga/hostgroup.cpp b/lib/icinga/hostgroup.cpp
index debd7bd..c79bb04 100644
--- a/lib/icinga/hostgroup.cpp
+++ b/lib/icinga/hostgroup.cpp
@@ -24,13 +24,7 @@ using namespace icinga;
 map<String, vector<Host::WeakPtr> > HostGroup::m_MembersCache;
 bool HostGroup::m_MembersCacheValid = true;
 
-static AttributeDescription hostGroupAttributes[] = {
-	{ "alias", Attribute_Config },
-	{ "notes_url", Attribute_Config },
-	{ "action_url", Attribute_Config }
-};
-
-REGISTER_TYPE(HostGroup, hostGroupAttributes);
+REGISTER_TYPE(HostGroup, NULL);
 
 String HostGroup::GetAlias(void) const
 {
diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp
index 68b716f..7771807 100644
--- a/lib/icinga/icingaapplication.cpp
+++ b/lib/icinga/icingaapplication.cpp
@@ -23,17 +23,7 @@
 
 using namespace icinga;
 
-static AttributeDescription icingaApplicationAttributes[] = {
-	{ "cert_path", Attribute_Config },
-	{ "ca_path", Attribute_Config },
-	{ "node", Attribute_Config },
-	{ "service", Attribute_Config },
-	{ "pid_path", Attribute_Config },
-	{ "state_path", Attribute_Config },
-	{ "macros", Attribute_Config }
-};
-
-REGISTER_TYPE(IcingaApplication, icingaApplicationAttributes);
+REGISTER_TYPE(IcingaApplication, NULL);
 
 #ifndef _WIN32
 #	include "icinga-version.h"
diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp
index c1184f1..b1aab63 100644
--- a/lib/icinga/service.cpp
+++ b/lib/icinga/service.cpp
@@ -22,17 +22,6 @@
 using namespace icinga;
 
 static AttributeDescription serviceAttributes[] = {
-	{ "alias", Attribute_Config },
-	{ "host_name", Attribute_Config },
-	{ "macros", Attribute_Config },
-	{ "check_command", Attribute_Config },
-	{ "max_check_attempts", Attribute_Config },
-	{ "check_interval", Attribute_Config },
-	{ "retry_interval", Attribute_Config },
-	{ "dependencies", Attribute_Config },
-	{ "servicegroups", Attribute_Config },
-	{ "checkers", Attribute_Config },
-
 	{ "scheduling_offset", Attribute_Transient },
 	{ "first_check", Attribute_Transient },
 	{ "next_check", Attribute_Replicated },
diff --git a/lib/icinga/servicegroup.cpp b/lib/icinga/servicegroup.cpp
index 942e121..b59d882 100644
--- a/lib/icinga/servicegroup.cpp
+++ b/lib/icinga/servicegroup.cpp
@@ -24,13 +24,7 @@ using namespace icinga;
 map<String, vector<Service::WeakPtr> > ServiceGroup::m_MembersCache;
 bool ServiceGroup::m_MembersCacheValid;
 
-static AttributeDescription serviceGroupAttributes[] = {
-	{ "alias", Attribute_Config },
-	{ "notes_url", Attribute_Config },
-	{ "action_url",  Attribute_Config }
-};
-
-REGISTER_TYPE(ServiceGroup, serviceGroupAttributes);
+REGISTER_TYPE(ServiceGroup, NULL);
 
 String ServiceGroup::GetAlias(void) const
 {
diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp
index 7e35ef2..b46caef 100644
--- a/lib/icinga/timeperiod.cpp
+++ b/lib/icinga/timeperiod.cpp
@@ -22,7 +22,6 @@
 using namespace icinga;
 
 static AttributeDescription timePeriodAttributes[] = {
-	{ "alias", Attribute_Config },
 	{ "cached_state", Attribute_Transient },
 	{ "cached_next_change", Attribute_Transient }
 };
diff --git a/lib/remoting/endpoint.cpp b/lib/remoting/endpoint.cpp
index ebe6f74..c927fdb 100644
--- a/lib/remoting/endpoint.cpp
+++ b/lib/remoting/endpoint.cpp
@@ -24,7 +24,6 @@ using namespace icinga;
 static AttributeDescription endpointAttributes[] = {
 	{ "node", Attribute_Replicated },
 	{ "service", Attribute_Replicated },
-	{ "local", Attribute_Config },
 	{ "subscriptions", Attribute_Replicated },
 	{ "client", Attribute_Transient }
 };





More information about the icinga-checkins mailing list