vagrant-vbguest-redhat-kernel-update 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da466fa5890abfd0184055d46420f3ff74c7746c
4
- data.tar.gz: 3447fcd8955ddb565200f62cd02d58e06877a2bc
3
+ metadata.gz: d8e3897106b414bce26564d069aed2d76b3eac3c
4
+ data.tar.gz: 2ca364d3958cccb25b8854d6ce410ee3b708a409
5
5
  SHA512:
6
- metadata.gz: 8ead4588f3e560f0b8e576fdcf6d18b68769e49043c25588a845209145726d67312cc67b9ce2ab8ade07870a65d3953051cd16cc8b3a425b627c57ba88ff95fd
7
- data.tar.gz: 6e9186e1aa7235494cc4963d0d8398990056387d687ff6549ddc223d40fd023116064c4ad626a12b1cf990bc6de4f44be6e3a4132b2bcbd26a810bc35d30c340
6
+ metadata.gz: bbfcb754e197e01396edc8716bf05f115d0e8194ffd63aec5e8042b92bf1d30f8161b8f51835ff6fadc206ba199e42f323b460516bb769183bbc5c816e46aa79
7
+ data.tar.gz: 26adf7a18feb25a3e9043e6e2bfb9fe1b8cb80249184785e3790d64715c664d26db639ac65d2a45b45e7bf4108a58e602f3a944d682232643a137f0887b7e0e1
@@ -20,7 +20,8 @@ module VagrantVbguestRedHatKernelUpdate
20
20
  protected
21
21
 
22
22
  def restart_additions(opts=nil, &block)
23
- communicate.sudo("/etc/init.d/vboxadd restart", opts, &block)
23
+ # TODO appropriate restart with systemd
24
+ communicate.sudo("[[ -f /etc/init.d/vboxadd ]] && /etc/init.d/vboxadd restart || :", opts, &block)
24
25
  end
25
26
 
26
27
  # TODO submit MR to have this in upstream
@@ -53,9 +54,37 @@ module VagrantVbguestRedHatKernelUpdate
53
54
  @env.ui.warn("Attempting to upgrade the kernel")
54
55
  communicate.sudo("yum -y upgrade kernel{,-devel,-headers}", opts, &block)
55
56
  @env.ui.warn("Restarting to activate upgraded kernel")
56
- reboot!(@vm, {:auto_reboot => true})
57
+
58
+ # should work from what I can tell, but doesn't :(
59
+ #vm.action(:reload, {});
60
+ reboot(@vm, {:auto_reboot => true})
61
+
62
+ # hide this reboot from vbguest
63
+ #@@rebooted[ self.class.vm_id(vm) ] = false
57
64
  end
58
65
 
66
+ # I have NFI why @vm.action(:reload) doesn't work!
67
+ # It's as though we can't hook into the action chain fully, and the result is
68
+ # there's a bogus check for the guest additions before the boot which causes
69
+ # failure
70
+ def reboot(vm, options)
71
+ simple_reboot = Vagrant::Action::Builder.new.tap do |b|
72
+ b.use Vagrant::Action::Builtin::Call, Vagrant::Action::Builtin::GracefulHalt, :poweroff, :running do |env2, b2|
73
+ if !env2[:result]
74
+ b2.use VagrantPlugins::ProviderVirtualBox::Action::ForcedHalt
75
+ end
76
+ end
77
+ b.use VagrantPlugins::ProviderVirtualBox::Action::Boot
78
+ if defined?(Vagrant::Action::Builtin::WaitForCommunicator)
79
+ b.use Vagrant::Action::Builtin::WaitForCommunicator, [:starting, :running]
80
+ end
81
+ end
82
+ # this is not ideal - we're just grabbing the bits we need to allow this to work
83
+ @env.action_runner().run(simple_reboot, {
84
+ :ui => @env.ui,
85
+ :machine => vm,
86
+ })
87
+ end
59
88
 
60
89
  end
61
90
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantVbguestRedHatKernelUpdate
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vbguest-redhat-kernel-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Sharpe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-15 00:00:00.000000000 Z
11
+ date: 2017-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vagrant-vbguest