From da8923512737f0d9383feaebaf43e781e914b71e Mon Sep 17 00:00:00 2001 From: Michael Baker Date: Thu, 23 Nov 2017 06:18:41 +0800 Subject: fix: GPG bug fix when loading file (#1109) * GPG bug fix * Update Sources.md * Update README.md --- lib/oxidized/source/csv.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/oxidized/source') diff --git a/lib/oxidized/source/csv.rb b/lib/oxidized/source/csv.rb index c1e310a..27cb49e 100644 --- a/lib/oxidized/source/csv.rb +++ b/lib/oxidized/source/csv.rb @@ -21,9 +21,9 @@ class CSV < Source def load nodes = [] file = File.expand_path(@cfg.file) - file = if @cfg.gpg? + if @cfg.gpg? crypto = GPGME::Crypto.new password: @cfg.gpg_password - crypto.decrypt(file).to_s + file = crypto.decrypt(File.open(file)).to_s else open(file) end -- cgit v1.2.1 From 919c46b85a78b63fc770bde1aaee91bcdd66dc84 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Thu, 23 Nov 2017 08:16:00 +0000 Subject: fixed csv source (#1113) --- lib/oxidized/source/csv.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/source') diff --git a/lib/oxidized/source/csv.rb b/lib/oxidized/source/csv.rb index 27cb49e..4814bd7 100644 --- a/lib/oxidized/source/csv.rb +++ b/lib/oxidized/source/csv.rb @@ -21,7 +21,7 @@ class CSV < Source def load nodes = [] file = File.expand_path(@cfg.file) - if @cfg.gpg? + file = if @cfg.gpg? crypto = GPGME::Crypto.new password: @cfg.gpg_password file = crypto.decrypt(File.open(file)).to_s else -- cgit v1.2.1