vagrant-openstack-provider
vagrant-openstack-provider copied to clipboard
Non-standard machines state causes problems for triggers
When using the run_remote on a destroy trigger like the following, it fails to work since the state isn't running:
node.trigger.before :destroy do |trigger|
trigger.name = "Removing salt key"
trigger.run_remote = { inline: "salt-call saltutil.revoke_auth" }
end
The error message is:
Could not run remote script on cephosd002 because its state is active
It appears like the code is only checking for the state to be running:
elsif @machine.state.id != :running
if on_error == :halt
raise Errors::TriggersGuestNotRunning,
machine_name: @machine.name,
state: @machine.state.id
else
@machine.ui.error(I18n.t("vagrant.errors.triggers_guest_not_running",
machine_name: @machine.name,
state: @machine.state.id))
@machine.ui.warn(I18n.t("vagrant.trigger.on_error_continue"))
return
end
end
I created an issue upsteam for this (https://github.com/hashicorp/vagrant/issues/10956), but they're thinking that the openstack provider should use the standard states instead (at least that's how I took it).