Skip to content

Commit

Permalink
Add warning for local settings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed Aug 30, 2024
1 parent e5a568d commit 5f6f892
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/vmdb/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def initialize(errors)
def self.init
::Config.overwrite_arrays = true
::Config.merge_nil_values = false
warn_on_local_changes
reset_settings_constant(for_resource(:my_server))
end

Expand Down Expand Up @@ -180,6 +181,13 @@ def self.local_sources
end
private_class_method :local_sources

def self.warn_on_local_changes
local_sources.each do |path|
warn "\e[1;33m** WARN: Local changes are present in #{path}\e[0m" if File.size?(path)
end
end
private_class_method :warn_on_local_changes

def self.replace_magic_values!(settings, resource)
parent_settings = nil

Expand Down

0 comments on commit 5f6f892

Please sign in to comment.