Skip to content

Commit

Permalink
unconditionally seed widgets, skeeping seed based on file's timestamp…
Browse files Browse the repository at this point in the history
… may lead to keep recotrds from older version (when timestamp on yaml file from older version is more resent)

https://bugzilla.redhat.com/show_bug.cgi?id=1494819
  • Loading branch information
yrudman committed Sep 28, 2017
1 parent 0b7e075 commit ce79a8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_widget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce79a8a

Please sign in to comment.