-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suspend checks extracted to common mixin https://bugzilla.redhat.com/show_bug.cgi?id=1455145
- Loading branch information
1 parent
8b42ce2
commit 67120c5
Showing
5 changed files
with
37 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module ProviderSuspendMixin | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
# @param name [String] name of metrics collection's target (ie. VM) | ||
def metrics_capture_suspended?(name = '') | ||
provider_suspended?("Metrics capture disabled [#{name}]") | ||
end | ||
|
||
# @param name [String] name of SmartState target (ie. Vm/Template/Host) | ||
def smartstate_analysis_suspended?(name = '') | ||
provider_suspended?("SmartState analysis disabled [#{name}]") | ||
end | ||
|
||
# Checks if ExtManagementSystem.enabled is false | ||
# @param log_message [String | nil] | ||
def provider_suspended?(log_message = nil) | ||
suspended = respond_to?(:ext_management_system) && !ext_management_system.enabled | ||
_log.debug("#{log_message} | Provider disabled: #{ext_management_system.name}") if suspended && log_message.present? | ||
suspended | ||
end | ||
end | ||
end |
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