Bug #78
closedPuppet reports fails with 0.24.4-5 master
Description
Both classes changed since puppet v 0.24.4
Used in app/models/report.rb :
Method "report.name" doesn't exist.
Also I got errors with report.metrics method [] :
failed to process report for my_hostname due to:undefined method `[]' for #<Puppet::Util::Metric:0x7fda716a6ed8>
Some datas can't be accessed :
report.metrics["resources"][:failed]
report.metrics["resources"][:skipped]
report.metrics["resources"][:failed_restarts]
report.metrics["changes"][:total]
And the fix (method name and [] dont exists)
46c46
< logger.info "processing report for #{report.name}"
---
logger.info "processing report for #{report.host}"
60c60
< logger.warn "failed to process report for #{report.name} due to:#{e}"
---
logger.warn "failed to process report for #{report.host} due to:#{e}"
103a104,108
resources_failed = resources.values.find { |v| v0 :failed }[2]
resources_skipped = resources.values.find { |v| v[0] :skipped }[2]
resources_failed_restarts = resources.values.find { |v| v0 :failed_restarts }[2]
total_report_changes = report.metrics["changes"].values.find { |v| v[0] :total }[2]
105,106c110,111
< if resources[:failed] + resources[:skipped] + resources[:failed_restarts] + report.metrics["changes"][:total] > 0
< status = resources[:failed] if resources[:failed] > 0
---
if resources_failed + resources_skipped + resources_failed_restarts + total_report_changes > 0
status = resources_failed if resources_failed > 0
110c115
< status |= resources[:skipped] if resources[:skipped] > 0 and report.logs.size >0
---
status |= resources_skipped if resources_skipped > 0 and report.logs.size >0
112c117
< status |= resources[:failed_restarts] << 24 if resources[:failed_restarts] > 0
---
status |= resources_failed_restarts << 24 if resources_failed_restarts > 0
122c127
< log.metrics[type][name]
---
log.metrics[type].values.find { |v| v0 == name }[2]
Files