-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #7436: Techniques that call _logger, _logger_default or logger_…
…rudder will break because these methods take 4 arguments now and no upgrade path has been planned
- Loading branch information
Showing
3 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
##################################################################################### | ||
# Copyright 2013-5 Normation SAS | ||
##################################################################################### | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, Version 3. | ||
# | ||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
##################################################################################### | ||
|
||
# @name Logger - legacy interface (DEPRECATED) | ||
# @description Standard logging output. This interface is for compatiblity with older generic methods and techniques, and is replaced by _log. | ||
# | ||
# @parameter message The common part of the message to display | ||
# @parameter old_class_prefix The prefix of the class for different states (0.x version) | ||
# @parameter origin_class_prefix The prefix of the class for different states (1.x version) | ||
# @parameter args The arguments used to call the generic method (slist) | ||
# | ||
# @class_prefix | ||
# @class_parameter old_class_prefix | ||
# The three states are kept, repaired and not_ok | ||
# (as defined in the classes_generic of the cfengine_stdlib) | ||
|
||
bundle agent _logger(message, old_class_prefix, origin_class_prefix, args) | ||
{ | ||
vars: | ||
"empty_slist" slist => { cf_null }; | ||
|
||
methods: | ||
"legacy _logger wrapper" usebundle => _log("${message}", "${old_class_prefix}", "", @{empty_slist}); | ||
|
||
reports: | ||
cfengine:: | ||
"WARNING: DEPRECATED _logger interface called. Please use _log instead (${old_class_prefix}: ${message})"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
##################################################################################### | ||
# Copyright 2013-5 Normation SAS | ||
##################################################################################### | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, Version 3. | ||
# | ||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
##################################################################################### | ||
|
||
# @name Logger default - legacy interface (DEPRECATED) | ||
# @description Standard default logging output. This interface is for compatiblity with older generic methods and techniques, and is replaced by _log_default. | ||
# | ||
# @parameter message The common part of the message to display | ||
# @parameter old_class_prefix The prefix of the class for different states (0.x version) | ||
# @parameter origin_class_prefix The prefix of the class for different states (1.x version) | ||
# @parameter args The arguments used to call the generic method (slist) | ||
# | ||
# @class_prefix _logger_default | ||
# @class_parameter old_class_prefix | ||
# The three states are kept, repaired and not_ok | ||
# (as defined in the classes_generic of the cfengine_stdlib) | ||
|
||
bundle agent _logger_default(message, old_class_prefix, origin_class_prefix, args) | ||
{ | ||
|
||
methods: | ||
"legacy _logger_default wrapper" usebundle => _log_default("${message}", "${old_class_prefix}", "", ""); | ||
|
||
reports: | ||
cfengine:: | ||
"WARNING: DEPRECATED _logger_default interface called. Please use _log_default instead (${old_class_prefix}: ${message})"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
##################################################################################### | ||
# Copyright 2015 Normation SAS | ||
##################################################################################### | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, Version 3. | ||
# | ||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
##################################################################################### | ||
|
||
# @name Logger for Rudder - legacy interface (DEPRECATED) | ||
# @description Logging output for Rudder reports. This interface is for compatiblity with older generic methods and techniques, and is replaced by log_rudder. | ||
# | ||
# @parameter message The common part of the message to display | ||
# @parameter old_class_prefix The prefix of the class for different states (0.x version, empty to force new style logging only) | ||
# | ||
# @class_prefix logger_rudder | ||
# @class_parameter old_class_prefix | ||
# The three states are kept, repaired and not_ok | ||
# (as defined in the classes_generic of the cfengine_stdlib) | ||
|
||
bundle agent logger_rudder(message, old_class_prefix) | ||
{ | ||
|
||
methods: | ||
"legacy logger_rudder wrapper" usebundle => log_rudder("${message}", "${old_class_prefix}", "", ""); | ||
|
||
reports: | ||
cfengine:: | ||
"WARNING: DEPRECATED logger_rudder interface called. Please use log_rudder instead (${old_class_prefix}: ${message})"; | ||
|
||
} |