Skip to content

Commit

Permalink
unconditionally seed all standard reports. Sometimes date of build fo…
Browse files Browse the repository at this point in the history
…r patch on new version could be older that build date of older version, and skipping file based on timestamp will lead to keeping records from old version

https://bugzilla.redhat.com/show_bug.cgi?id=1494819
  • Loading branch information
yrudman committed Sep 28, 2017
1 parent 1c1c27d commit 0b7e075
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/miq_report/seeding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def sync_from_file(filename, dir, typ)
rec = find_by_filename(rpt[:filename])

if rec
if rec.filename && (rec.file_mtime.nil? || rec.file_mtime.utc < rpt[:file_mtime])
_log.info("#{typ.titleize}: [#{rec.name}] file has been updated on disk, synchronizing with model")
if rec.filename
_log.info("#{typ.titleize}: [#{rec.name}] file exists, synchronizing with model")
rec.update_attributes(rpt)
rec.save
end
Expand Down

0 comments on commit 0b7e075

Please sign in to comment.