Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-standard machines state causes problems for triggers #387

Open
bstillwell opened this issue Jul 9, 2019 · 0 comments
Open

Non-standard machines state causes problems for triggers #387

bstillwell opened this issue Jul 9, 2019 · 0 comments

Comments

@bstillwell
Copy link

bstillwell commented Jul 9, 2019

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 (hashicorp/vagrant#10956), but they're thinking that the openstack provider should use the standard states instead (at least that's how I took it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant