From 0b7ba05032a4faed9dba37bcc2a2b9a59ca81e96 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Tue, 30 Mar 2021 22:06:13 +0200 Subject: [PATCH] M #-: onecfg suppress Ruby Augeas warnings --- src/onecfg/lib/config/type/augeas.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/onecfg/lib/config/type/augeas.rb b/src/onecfg/lib/config/type/augeas.rb index ff65049440..7b590db9a8 100644 --- a/src/onecfg/lib/config/type/augeas.rb +++ b/src/onecfg/lib/config/type/augeas.rb @@ -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")