diff --git a/engine/precomp_inc/precomp.hh b/engine/precomp_inc/precomp.hh index 1e8f7049c71..1dd3e533805 100644 --- a/engine/precomp_inc/precomp.hh +++ b/engine/precomp_inc/precomp.hh @@ -1,21 +1,21 @@ -/* -** Copyright 2022 Centreon -** -** This file is part of Centreon Engine. -** -** Centreon Engine is free software: you can redistribute it and/or -** modify it under the terms of the GNU General Public License version 2 -** as published by the Free Software Foundation. -** -** Centreon Engine is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Centreon Engine. If not, see -** . -*/ +/** + * Copyright 2022 Centreon + * + * This file is part of Centreon Engine. + * + * Centreon Engine is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * Centreon Engine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Centreon Engine. If not, see + * . + */ #ifndef CCE_PRECOMP_HH #define CCE_PRECOMP_HH @@ -66,6 +66,7 @@ #include #include +#include #include #include #include diff --git a/engine/src/configuration/object.cc b/engine/src/configuration/object.cc index 76fd084e27f..5c87c1498f3 100644 --- a/engine/src/configuration/object.cc +++ b/engine/src/configuration/object.cc @@ -1,21 +1,21 @@ -/* -** Copyright 2011-2014 Merethis -** -** This file is part of Centreon Engine. -** -** Centreon Engine is free software: you can redistribute it and/or -** modify it under the terms of the GNU General Public License version 2 -** as published by the Free Software Foundation. -** -** Centreon Engine is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Centreon Engine. If not, see -** . -*/ +/** + * Copyright 2011-2014 Merethis + * + * This file is part of Centreon Engine. + * + * Centreon Engine is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * Centreon Engine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Centreon Engine. If not, see + * . + */ #include "com/centreon/engine/configuration/object.hh" #include "com/centreon/engine/configuration/anomalydetection.hh" @@ -204,7 +204,7 @@ bool object::parse(std::string const& line) { key.assign(line, 0, pos); value.assign(line, pos + 1, std::string::npos); } - string::trim(value); + boost::algorithm::trim(value); if (!parse(key.c_str(), value.c_str())) return object::parse(key.c_str(), value.c_str()); return true; diff --git a/engine/src/string.cc b/engine/src/string.cc index 77fa2765d1b..6ed5c8b10d2 100644 --- a/engine/src/string.cc +++ b/engine/src/string.cc @@ -41,7 +41,7 @@ bool string::get_next_line(std::ifstream& stream, unsigned int& pos) { while (std::getline(stream, line, '\n')) { ++pos; - string::trim(line); + boost::algorithm::trim(line); if (!line.empty()) { char c(line[0]); if (c != '#' && c != ';' && c != '\x0') diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index 61b2f2e606d..18406b0b383 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -288,3 +288,38 @@ EMACROS_NOTIF Stop Engine Kindly Stop Broker + +EMACROS_SEMICOLON + [Documentation] Macros with a semicolon are used even if they contain a semicolon. + [Tags] engine external_cmd macros MON-35560 + Config Engine ${1} + Config Broker central + Config Broker rrd + Config Broker module ${1} + Engine Config Set Value ${0} log_legacy_enabled ${0} + Engine Config Set Value ${0} log_v2_enabled ${1} + Engine Config Set Value 0 log_level_checks trace True + Engine Config Set Value In Hosts 0 host_1 _KEY2 VAL1;val3; + Engine Config Change Command + ... 0 + ... \\d+ + ... /bin/echo "KEY2=$_HOSTKEY2$" + Clear Retention + ${start} Get Current Date + Start Engine + Start Broker + + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True + ... ${result} + ... An Initial host state on host_1 should be raised before we can start our external commands. + Schedule Forced Svc Check host_1 service_1 + Sleep 5s + + ${content} Create List KEY2=VAL1;val3; + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} VAL1;val3; not found in log. + + Stop Engine + Kindly Stop Broker