diff --git a/CMakeLists.txt b/CMakeLists.txt index 4537ea248..b04810e1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ include_directories("${INC_DIR}/compatibility") # Version. set(CENTREON_ENGINE_MAJOR 19) set(CENTREON_ENGINE_MINOR 10) -set(CENTREON_ENGINE_PATCH 2) +set(CENTREON_ENGINE_PATCH 3) if (CENTREON_ENGINE_PRERELEASE) set(CENTREON_ENGINE_VERSION "${CENTREON_ENGINE_MAJOR}.${CENTREON_ENGINE_MINOR}.${CENTREON_ENGINE_PATCH}-${CENTREON_ENGINE_PRERELEASE}") else () diff --git a/doc/release_notes/engine19.10.rst b/doc/release_notes/engine19.10.rst index 0fd231849..8252afb12 100644 --- a/doc/release_notes/engine19.10.rst +++ b/doc/release_notes/engine19.10.rst @@ -1,3 +1,15 @@ +======================= +Centreon Engine 19.10.3 +======================= + +********* +Bug fixes +********* + +Service escalation not well resolved +==================================== +Service configurations look up failed when service escalations were defined. + ======================= Centreon Engine 19.10.2 ======================= diff --git a/inc/com/centreon/engine/configuration/state.hh b/inc/com/centreon/engine/configuration/state.hh index a35db9485..130790d93 100644 --- a/inc/com/centreon/engine/configuration/state.hh +++ b/inc/com/centreon/engine/configuration/state.hh @@ -354,8 +354,6 @@ namespace configuration { servicegroups_find(servicegroup::key_type const& k); set_service const& services() const throw (); set_service& services() throw (); - set_service::const_iterator - services_find(service::key_type const& k) const; set_service::iterator services_find(service::key_type const& k); set_service::const_iterator diff --git a/src/configuration/state.cc b/src/configuration/state.cc index 4ff113a0c..5af2316de 100644 --- a/src/configuration/state.cc +++ b/src/configuration/state.cc @@ -2954,31 +2954,6 @@ set_service& state::services() throw () { return _services; } -/** - * Get service by its key. - * - * @param[in] k Service name. - * - * @return Iterator to the element if found, services().end() - * otherwise. - */ -set_service::const_iterator state::services_find( - service::key_type const& k) const { - configuration::service below_searched; - below_searched.set_host_id(k.first); - below_searched.set_service_id(k.second); - set_service::const_iterator it{_services.upper_bound(below_searched)}; - if (it != _services.end() - && it->host_id() == k.first - && it->service_id() == k.second) - return it; - else if (it != _services.begin() - && (--it)->host_id() == k.first - && it->service_id() == k.second) - return it; - return _services.end(); -} - /** * Get service by its key. * @@ -3006,19 +2981,12 @@ set_service::iterator state::services_find( set_service::const_iterator state::services_find( std::string const& host_name, std::string const& service_desc) const { - configuration::service below_searched; - below_searched.hosts().insert(host_name); - below_searched.service_description() = service_desc; - set_service::iterator - it(_services.upper_bound(below_searched)); - if (it != _services.end() - && *it->hosts().begin() == host_name - && it->service_description() == service_desc) - return it; - else if (it != _services.begin() - && *(--it)->hosts().begin() == host_name - && it->service_description() == service_desc) - return it; + for (auto it = _services.begin(), end = _services.end(); + it != end; ++it) { + if (it->service_description() == service_desc + && *it->hosts().begin() == host_name) + return it; + } return _services.end(); }