Bug #78

Puppet reports fails with 0.24.4-5 master

Added by Benoit CATTIE over 8 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assigned To:Benoit CATTIE
Category:Puppet Reports
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-

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]

report.rb.patch Magnifier (2.5 KB) Benoit CATTIE, 11/12/2009 08:40 PM


Related issues

Blocked by Foreman - Refactor #80: Reports data should be accessed in a simple way Closed 11/17/2009

History

#1 Updated by Benoit CATTIE over 8 years ago

Hum better with a file :)

#2 Updated by Ohad Levy over 8 years ago

  • Subject changed from Puppet::Transaction::Report and Puppet::Util::Metric changes to Puppet reports fails with 0.24.4 master
  • Status changed from New to Assigned
  • Target version set to 0.1-3

#3 Updated by Ohad Levy over 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Assigned To changed from Ohad Levy to Benoit CATTIE

I've made a few changes, can you test it with the version in edge branch works?
http://github.com/ohadlevy/foreman/tree/edge

Thanks

#4 Updated by Ohad Levy over 8 years ago

  • Subject changed from Puppet reports fails with 0.24.4 master to Puppet reports fails with 0.24.4-5 master

#5 Updated by Ohad Levy over 8 years ago

  • Target version changed from 0.1-3 to 0.1-4

waiting for feedback, pushing a version for now

#6 Updated by Benoit CATTIE over 8 years ago

Hi

i just migrate to puppet 0.25.

i can't test anymore with 0.24.4

Sorry

#7 Updated by Ohad Levy over 8 years ago

  • Target version deleted (0.1-4)

#8 Updated by Ohad Levy over 7 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF