M #-: onecfg suppress Ruby Augeas warnings

This commit is contained in:
Vlastimil Holer committed 2021-03-30 22:06:13 +02:00
1 parent 3269e2c69e
commit 0b7ba05032
1 file changed
+13 -4
+13 -4
View File
@@ -64,10 +64,19 @@ module OneCfg::Config::Type
:root => work_file_dir,
:loadpath => @load_path)
aug.clear_transforms
aug.transform(:lens => @lens, :incl => work_file_name)
aug.context = "/files/#{work_file_name}"
aug.load
begin
# Temporarily suppress Ruby warnings due to
# augeas.rb:378: warning: constant ::Fixnum is deprecated
verb = $VERBOSE
$VERBOSE = nil
aug.clear_transforms
aug.transform(:lens => @lens, :incl => work_file_name)
aug.context = "/files/#{work_file_name}"
aug.load
ensure
$VERBOSE = verb
end
# validate there was no Augeas error
if aug.exists("/augeas#{aug.context}/error")