Class: InsightsCloud::Async::CloudConnectorAnnounceTask
- Inherits:
-
Actions::EntryAction
- Object
- Actions::EntryAction
- InsightsCloud::Async::CloudConnectorAnnounceTask
- Defined in:
- lib/insights_cloud/async/cloud_connector_announce_task.rb
Class Method Summary collapse
Instance Method Summary collapse
- #connector_feature_id ⇒ Object
- #connector_playbook_job?(job_invocation) ⇒ Boolean
- #finalize ⇒ Object
- #logger ⇒ Object
- #plan(job_invocation) ⇒ Object
- #rescue_strategy_for_self ⇒ Object
Class Method Details
.connector_feature_id ⇒ Object
8 9 10 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 8 def self.connector_feature_id @connector_feature_id ||= RemoteExecutionFeature.feature!(ForemanRhCloud::CloudConnector::CLOUD_CONNECTOR_FEATURE).id end |
.subscribe ⇒ Object
4 5 6 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 4 def self.subscribe Actions::RemoteExecution::RunHostsJob end |
Instance Method Details
#connector_feature_id ⇒ Object
35 36 37 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 35 def connector_feature_id self.class.connector_feature_id end |
#connector_playbook_job?(job_invocation) ⇒ Boolean
31 32 33 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 31 def connector_playbook_job?(job_invocation) job_invocation&.remote_execution_feature_id == connector_feature_id end |
#finalize ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 18 def finalize Organization.unscoped.each do |org| presence = ForemanRhCloud::CloudPresence.new(org, logger) presence.announce_to_sources rescue StandardError => ex logger.warn(ex) end end |
#logger ⇒ Object
39 40 41 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 39 def logger action_logger end |
#plan(job_invocation) ⇒ Object
12 13 14 15 16 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 12 def plan(job_invocation) return unless connector_playbook_job?(job_invocation) plan_self end |
#rescue_strategy_for_self ⇒ Object
27 28 29 |
# File 'lib/insights_cloud/async/cloud_connector_announce_task.rb', line 27 def rescue_strategy_for_self Dynflow::Action::Rescue::Skip end |