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

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


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

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
expected.

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=61d6203fe7b1dfdb5679480227a39a09d04ab3b1




More information about the icinga-checkins mailing list