guests/suse: fix error on shutdown
This commit is contained in:
parent
b52d60d178
commit
5180f4b647
|
@ -13,6 +13,7 @@ BUG FIXES:
|
||||||
- core: Allow provisioner plugins to not have a config class. [GH-3272]
|
- core: Allow provisioner plugins to not have a config class. [GH-3272]
|
||||||
- commands/status: Machine readable output contains the target. [GH-3218]
|
- commands/status: Machine readable output contains the target. [GH-3218]
|
||||||
- guests/debian: Changing host name works properly. [GH-3283]
|
- guests/debian: Changing host name works properly. [GH-3283]
|
||||||
|
- guests/suse: Shutdown works correctly on SLES [GH-2775]
|
||||||
- synced\_folders/smb: IDs of synced folders are hashed to work better
|
- synced\_folders/smb: IDs of synced folders are hashed to work better
|
||||||
with VMware. [GH-3219]
|
with VMware. [GH-3219]
|
||||||
- synced\_folders/smb: Passwords with symbols now work. [GH-3242]
|
- synced\_folders/smb: Passwords with symbols now work. [GH-3242]
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
module VagrantPlugins
|
||||||
|
module GuestSuse
|
||||||
|
module Cap
|
||||||
|
class Halt
|
||||||
|
def self.halt(machine)
|
||||||
|
begin
|
||||||
|
machine.communicate.sudo("/sbin/shutdown -h now")
|
||||||
|
rescue IOError
|
||||||
|
# Do nothing, because it probably means the machine shut down
|
||||||
|
# and SSH connection was lost.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -16,6 +16,11 @@ module VagrantPlugins
|
||||||
Cap::ChangeHostName
|
Cap::ChangeHostName
|
||||||
end
|
end
|
||||||
|
|
||||||
|
guest_capability("suse", "halt") do
|
||||||
|
require_relative "cap/halt"
|
||||||
|
Cap::Halt
|
||||||
|
end
|
||||||
|
|
||||||
guest_capability("suse", "configure_networks") do
|
guest_capability("suse", "configure_networks") do
|
||||||
require_relative "cap/configure_networks"
|
require_relative "cap/configure_networks"
|
||||||
Cap::ConfigureNetworks
|
Cap::ConfigureNetworks
|
||||||
|
|
Loading…
Reference in New Issue