-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #8194: file_check_ on branch master use deprecated _logger interface #343
Merged
jooooooon
merged 1 commit into
Normation:master
from
ncharles:bug_8194/file_check_on_branch_master_use_deprecated_logger_interface
Apr 27, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
|
@@ -33,7 +33,12 @@ bundle agent file_check_special(file_name, file_type) | |
{ | ||
vars: | ||
"file_has_type" string => filestat("${file_name}", "type"); | ||
"class_prefix" string => canonify("file_check_${file_type}_${file_name}"); | ||
|
||
"old_class_prefix" string => canonify("file_check_${file_type}_${file_name}"); | ||
"promisers" slist => { @{this.callers_promisers}, cf_null }, policy => "ifdefined"; | ||
"class_prefix" string => canonify(join("_", "promisers")); | ||
"args" slist => { "${file_name}", "${file_type}" }; | ||
|
||
|
||
classes: | ||
"file_exists" expression => fileexists("${file_name}"); | ||
|
@@ -43,14 +48,18 @@ bundle agent file_check_special(file_name, file_type) | |
|
||
methods: | ||
exists_special:: | ||
"file_exists_and_is_special" | ||
usebundle => _classes_success("${old_class_prefix}"); | ||
"file_exists_and_is_special" | ||
usebundle => _classes_success("${class_prefix}"); | ||
|
||
!exists_special:: | ||
"file_doesnt_exists_or_is_not_special" | ||
usebundle => _classes_failure("${old_class_prefix}"); | ||
"file_doesnt_exists_or_is_not_special" | ||
usebundle => _classes_failure("${class_prefix}"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
|
||
any:: | ||
"report" | ||
usebundle => _logger("Check if ${file_name} exists and is a ${file_type}", "${class_prefix}"); | ||
usebundle => _log("Check if ${file_name} exists and is a ${file_type}", "${old_class_prefix}", "${class_prefix}", @{args}); | ||
} |
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
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would normally only call the _classes_success method for the new class_prefix if the has_promiser_stack class is defined. See for example https://github.com/Normation/ncf/blob/master/tree/30_generic_methods/_service_check_running_src.cf#L50.