Class: Foreman::PuppetReportScanner

Inherits:
Object
  • Object
show all
Defined in:
app/services/report_scanner/puppet_report_scanner.rb

Class Method Summary collapse

Class Method Details

.add_reporter_data(report, report_data) ⇒ Object


8
9
10
# File 'app/services/report_scanner/puppet_report_scanner.rb', line 8

def add_reporter_data(report, report_data)
  # no additional data apart of origin
end

.identify_origin(report_data) ⇒ Object


4
5
6
# File 'app/services/report_scanner/puppet_report_scanner.rb', line 4

def identify_origin(report_data)
  'Puppet' if puppet_report?(report_data['logs'] || [])
end

.puppet_report?(logs) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
15
# File 'app/services/report_scanner/puppet_report_scanner.rb', line 12

def puppet_report?(logs)
  log = logs.last
  log && log['log'].fetch('sources', {}).fetch('source', '') =~ /Puppet/
end