[icinga-checkins] icinga.org: icinga2/mfriedrich/config: ConfigConvert: refactor host-svc links, add full service/usergroup relinking

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


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Fri Apr  5 17:20:56 2013 +0200

ConfigConvert: refactor host-svc links, add full service/usergroup relinking

due to the relinking afterwards we actually modify the service objects
already prepared for 2x. since the *group magic depends on the
host/services/users already prepared, we get a perpetuum mobile here
with the host loop and resolving service relations.

in order to safely fix the issue, there's a seperate host-service link
loop after resolving all the other needed objects, which may cost a
little bit more performance, but is safe and standalone, getting all
previous modifications, migrations and also hacks.

next to the refactored flow, the issue with resolving the correct
servicegroups and stashing them into an array is solved, as well as
converting the existing contactgroups to usergroups, as well as
re-linking existing contactgroup->members to their new home,
user->usergroups.

note: when parsing the servicegroup members into an array, it must not
be sorted afterwards, because we will shift 2 objects (host, service) in
order to identify the correct service object for adding the servicegroup
item.

some code reorganisation too, plus a minor comma fix for the host
address macro.

the used 1x configuration will be addressed in 2743.cfg on
icinga-core.git, with all future additions.

refs #2743

---

 contrib/configconvert/Icinga2/Convert.pm        |  426 +++++++++++++----------
 contrib/configconvert/Icinga2/DumpIcinga2Cfg.pm |   12 +-
 2 files changed, 249 insertions(+), 189 deletions(-)

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




More information about the icinga-checkins mailing list