From 7fd444d3011449c089925ba9da0b8ff51d935e6f Mon Sep 17 00:00:00 2001 From: Jared Quick Date: Mon, 30 Oct 2017 10:23:25 -0400 Subject: [PATCH] add skip empty line on os_release detect Signed-off-by: Jared Quick --- lib/train/platforms/detect/os_linux.rb | 1 + lib/train/transports/local.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/train/platforms/detect/os_linux.rb b/lib/train/platforms/detect/os_linux.rb index 467e91ac..dec83188 100644 --- a/lib/train/platforms/detect/os_linux.rb +++ b/lib/train/platforms/detect/os_linux.rb @@ -30,6 +30,7 @@ def parse_os_release_info(raw) raw.lines.each_with_object({}) do |line, memo| line.strip! + next if line.empty? key, value = line.split('=', 2) memo[key] = value.gsub(/\A"|"\Z/, '') unless value.empty? end diff --git a/lib/train/transports/local.rb b/lib/train/transports/local.rb index d5df1362..271440c4 100644 --- a/lib/train/transports/local.rb +++ b/lib/train/transports/local.rb @@ -17,7 +17,6 @@ def connection(_ = nil) end class Connection < BaseConnection - def initialize(options) super(options) @cmd_wrapper = nil