[icinga-checkins] icinga.org: icinga2/feature/configconvert-2743: ConfigConvert: refactor multiple host_name's on service object detection

git at icinga.org git at icinga.org
Thu May 2 22:17:32 CEST 2013

Module: icinga2
Branch: feature/configconvert-2743
Commit: ea3cbc21f97aeb36d6c0e045673186739ee78c39
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=ea3cbc21f97aeb36d6c0e045673186739ee78c39

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Apr  4 23:06:03 2013 +0200

ConfigConvert: refactor multiple host_name's on service object detection

this is ugly. a service object may contain 'host_name' with
'host1,host2,host3' and so on. treating this as string won't allow us to
look into the template tree for valid host attributes, so we need to
rewrite the getter function, allowing some special treatment on
host_name arrays.

for the service object preparation this means: while in the service
loop, we need to loop again over all hosts, then dclone the hashref
object for the service, and add the unique host_name attribute again.

we might require some loop unrolling later, but for now this works as

refs #2743


 contrib/configconvert/Icinga2/Convert.pm |  252 +++++++++++++++++++----------
 1 files changed, 165 insertions(+), 87 deletions(-)

Diff:   https://git.icinga.org/?p=icinga2.git;a=commitdiff;h=ea3cbc21f97aeb36d6c0e045673186739ee78c39

More information about the icinga-checkins mailing list