Class: ForemanRhCloud::RemediationsRetriever

Inherits:
Object
  • Object
show all
Includes:
CertAuth
Defined in:
app/services/foreman_rh_cloud/remediations_retriever.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CertAuth

#cert_auth_available?, #execute_cloud_request

Methods included from InsightsCloud::CandlepinCache

#candlepin_id_cert, #cp_owner_id, #upstream_owner

Methods included from CloudRequest

#execute_cloud_request

Constructor Details

#initialize(logger: Logger.new(IO::NULL)) ⇒ RemediationsRetriever

Returns a new instance of RemediationsRetriever.



7
8
9
# File 'app/services/foreman_rh_cloud/remediations_retriever.rb', line 7

def initialize(logger: Logger.new(IO::NULL))
  @logger = logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



5
6
7
# File 'app/services/foreman_rh_cloud/remediations_retriever.rb', line 5

def logger
  @logger
end

Instance Method Details

#create_playbookObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/services/foreman_rh_cloud/remediations_retriever.rb', line 11

def create_playbook
  unless cert_auth_available?(organization)
    logger.debug('Manifest is not available, cannot continue')
    return
  end

  response = query_playbook

  logger.debug("Got playbook response: #{response.body}")

  response.body
end