[icinga-checkins] icinga.org: icinga2/feature/configconvert-2743: configconvert: fix multiple templates usage, template object lookup error

git at icinga.org git at icinga.org
Mon Apr 29 21:05:45 CEST 2013

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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Apr 29 20:46:38 2013 +0200

configconvert: fix multiple templates usage, template object lookup error

multiple host/service templates seperated by commas will cause some
irritation, therefore this is treated as array internally, like group
members. for the config export and "inherits", this is easy to fix. for
the actual host_name lookup for service objects, this unveiled another
bug when looping through all available templates - they are unique by
'name' and not by hostname/servicedesc, and require their very own
getter - obj_get_tmpl_obj_by_tmpl_name() - which makes sure to return
the object which is then looked into recursively if there's a host_name

possible bug for now - multiple service templates used and the host_name is
defined in one of them. but that's not the usual case, and won't be
supported for now.

refs #2743
fixes #3932


 contrib/configconvert/Icinga2/Convert.pm          |  157 ++++++++++++++------
 contrib/configconvert/Icinga2/ExportIcinga2Cfg.pm |  162 +++++++++++----------
 contrib/configconvert/icinga2_convert_v1_v2.pl    |    3 +-
 3 files changed, 199 insertions(+), 123 deletions(-)

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

More information about the icinga-checkins mailing list