Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed May 20, 2024
1 parent 80aa161 commit 2439da8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/vagrant.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From f67d4f75eb2d97601df3cfe491ed4594422f190b Mon Sep 17 00:00:00 2001
From: Paul Cacheux <[email protected]>
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
- name: Check virtualbox version
run: |
which vagrant
ls -alh /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/virtualbox/
patch -d /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/ < .github/vagrant.patch
vagrant --version
vagrant init hashicorp/bionic64
vagrant up --provider=virtualbox
Expand Down

0 comments on commit 2439da8

Please sign in to comment.