diff --git a/app/models/miq_report/seeding.rb b/app/models/miq_report/seeding.rb index d443fe79cb6..8e4782306fb 100644 --- a/app/models/miq_report/seeding.rb +++ b/app/models/miq_report/seeding.rb @@ -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 diff --git a/app/models/miq_widget.rb b/app/models/miq_widget.rb index 04495f01cac..861e0fe948d 100644 --- a/app/models/miq_widget.rb +++ b/app/models/miq_widget.rb @@ -472,7 +472,7 @@ def self.sync_from_hash(attrs) widget = find_by(:description => attrs["description"]) if widget - if filename && widget.updated_at.utc < File.mtime(filename).utc + if filename $log.info("Widget: [#{widget.description}] file has been updated on disk, synchronizing with model") ["enabled", "visibility"].each { |a| attrs.delete(a) } # Don't updates these because they may have been modofoed by the end user. widget.updated_at = Time.now.utc