From f67d4f75eb2d97601df3cfe491ed4594422f190b Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Mon, 20 May 2024 14:50:01 +0200 Subject: [PATCH] virtualbox version detection: handle WARNING lines --- plugins/providers/virtualbox/driver/meta.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/providers/virtualbox/driver/meta.rb b/plugins/providers/virtualbox/driver/meta.rb index 63af500c65a..413574e4125 100644 --- a/plugins/providers/virtualbox/driver/meta.rb +++ b/plugins/providers/virtualbox/driver/meta.rb @@ -197,7 +197,11 @@ def read_version end end - parts = output.split("_") + version_line = output.each_line.find do |line| + !line.start_with?("WARNING:") + end + + parts = version_line.split("_") return nil if parts.empty? parts[0].split("r")[0] end