mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-07-16 12:25:43 -04:00
Some checks failed
/ sync-acceptance (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.1 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.2 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.3 (push) Has been cancelled
Vagrant Ruby Tests / Vagrant unit tests on Ruby 3.4 (push) Has been cancelled
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
25 lines
709 B
Ruby
25 lines
709 B
Ruby
# Copyright IBM Corp. 2010, 2025
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
module VagrantPlugins
|
|
module GuestSmartos
|
|
module Cap
|
|
class Halt
|
|
def self.halt(machine)
|
|
# There should be an exception raised if the line
|
|
#
|
|
# vagrant::::profiles=Primary Administrator
|
|
#
|
|
# does not exist in /etc/user_attr. TODO
|
|
begin
|
|
machine.communicate.execute(
|
|
"#{machine.config.smartos.suexec_cmd} /usr/sbin/poweroff")
|
|
rescue IOError, Vagrant::Errors::SSHDisconnected
|
|
# Ignore, this probably means connection closed because it
|
|
# shut down.
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|