[icinga-checkins] icinga.org: icinga-core/test/core: * core: allow empty host groups in service and host dependencies if allow_empty_hostgroup_assignment flag is set (Daniel Wittenberg) #2255

git at icinga.org git at icinga.org
Sun Feb 5 14:03:51 CET 2012


Module: icinga-core
Branch: test/core
Commit: 5529ef6e284f41f503d23fe659ad66b1b648730a
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=5529ef6e284f41f503d23fe659ad66b1b648730a

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Sun Feb  5 12:48:06 2012 +0100

* core: allow empty host groups in service and host dependencies if allow_empty_hostgroup_assignment flag is set (Daniel Wittenberg) #2255

refs #2255

---

 Changelog           |    1 +
 THANKS              |    1 +
 xdata/xodtemplate.c |    8 ++++----
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Changelog b/Changelog
index a688776..65cc5b4 100644
--- a/Changelog
+++ b/Changelog
@@ -11,6 +11,7 @@ ENHANCEMENTS
 * core: fix event removal from queues with O(1) removal from doubly linked lists (Andreas Ericsson) #2183
 * core: avoid senseless looping when free()'ing macros (Andreas Ericsson) #2184
 * core: avoid insane looping through event list when rescheduling checks (Mathias Kettner, Andreas Ericsson) #2182
+* core: allow empty host groups in service and host dependencies if allow_empty_hostgroup_assignment flag is set (Daniel Wittenberg) #2255
 
 FIXES
 * core: Plug some macro leaks triggered when sending notifications (Andreas Ericsson) #2109
diff --git a/THANKS b/THANKS
index 15124e8..1bfc537 100644
--- a/THANKS
+++ b/THANKS
@@ -328,6 +328,7 @@ in various ways.  If we missed your name, let us know.
 * Chris Witterholt
 * Evan Winter
 * Alexander Wirt
+* Daniel Wittenberg
 * Armin Wolfermann
 * Greg Woods
 * Cliff Woolley
diff --git a/xdata/xodtemplate.c b/xdata/xodtemplate.c
index e6772fe..2ef1517 100644
--- a/xdata/xodtemplate.c
+++ b/xdata/xodtemplate.c
@@ -4429,14 +4429,14 @@ int xodtemplate_duplicate_objects(void) {
 
 		/* get list of master host names */
 		master_hostlist = xodtemplate_expand_hostgroups_and_hosts(temp_hostdependency->hostgroup_name, temp_hostdependency->host_name, temp_hostdependency->_config_file, temp_hostdependency->_start_line);
-		if (master_hostlist == NULL) {
+		if (master_hostlist == NULL && allow_empty_hostgroup_assignment==0) {
 			logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Could not expand master hostgroups and/or hosts specified in host dependency (config file '%s', starting on line %d)\n", xodtemplate_config_file_name(temp_hostdependency->_config_file), temp_hostdependency->_start_line);
 			return ERROR;
 		}
 
 		/* get list of dependent host names */
 		dependent_hostlist = xodtemplate_expand_hostgroups_and_hosts(temp_hostdependency->dependent_hostgroup_name, temp_hostdependency->dependent_host_name, temp_hostdependency->_config_file, temp_hostdependency->_start_line);
-		if (dependent_hostlist == NULL) {
+		if (dependent_hostlist == NULL && allow_empty_hostgroup_assignment==0) {
 			logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Could not expand dependent hostgroups and/or hosts specified in host dependency (config file '%s', starting on line %d)\n", xodtemplate_config_file_name(temp_hostdependency->_config_file), temp_hostdependency->_start_line);
 			xodtemplate_free_memberlist(&master_hostlist);
 			return ERROR;
@@ -4568,7 +4568,7 @@ int xodtemplate_duplicate_objects(void) {
 #endif
 
 			master_hostlist = xodtemplate_expand_hostgroups_and_hosts(temp_servicedependency->hostgroup_name, temp_servicedependency->host_name, temp_servicedependency->_config_file, temp_servicedependency->_start_line);
-			if (master_hostlist == NULL) {
+			if (master_hostlist == NULL && allow_empty_hostgroup_assignment==0) {
 				logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Could not expand master hostgroups and/or hosts specified in service dependency (config file '%s', starting on line %d)\n", xodtemplate_config_file_name(temp_servicedependency->_config_file), temp_servicedependency->_start_line);
 				return ERROR;
 			}
@@ -4760,7 +4760,7 @@ int xodtemplate_duplicate_objects(void) {
 		if (temp_servicedependency->dependent_host_name != NULL || temp_servicedependency->dependent_hostgroup_name != NULL) {
 
 			dependent_hostlist = xodtemplate_expand_hostgroups_and_hosts(temp_servicedependency->dependent_hostgroup_name, temp_servicedependency->dependent_host_name, temp_servicedependency->_config_file, temp_servicedependency->_start_line);
-			if (dependent_hostlist == NULL) {
+			if (dependent_hostlist == NULL && allow_empty_hostgroup_assignment==0) {
 				logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Could not expand dependent hostgroups and/or hosts specified in service dependency (config file '%s', starting on line %d)\n", xodtemplate_config_file_name(temp_servicedependency->_config_file), temp_servicedependency->_start_line);
 				return ERROR;
 			}





More information about the icinga-checkins mailing list