emyl / vagrant-triggers

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
MIT License
546 stars 35 forks source link

run bug #34

Closed CreativeOutbreak closed 9 years ago

CreativeOutbreak commented 9 years ago

I seems to be having a slight issue when trying to run any code using this plugin. It used to work fine for me, but now I get this error every time:

/home/pete/.vagrant.d/gems/gems/vagrant-triggers-0.4.3/lib/vagrant-triggers/dsl.rb:25:in `run': uninitialized constant VagrantPlugins::Triggers::DSL::Bundler (NameError)
    from /var/www/git-repository/newint-agile/newint_vagrant/Vagrantfile:173:in `block (2 levels) in <top (required)>'
    from /home/pete/.vagrant.d/gems/gems/vagrant-triggers-0.4.3/lib/vagrant-triggers/action/trigger.rb:59:in `instance_eval'
    from /home/pete/.vagrant.d/gems/gems/vagrant-triggers-0.4.3/lib/vagrant-triggers/action/trigger.rb:59:in `block in fire_triggers'
    from /home/pete/.vagrant.d/gems/gems/vagrant-triggers-0.4.3/lib/vagrant-triggers/action/trigger.rb:56:in `each'
    from /home/pete/.vagrant.d/gems/gems/vagrant-triggers-0.4.3/lib/vagrant-triggers/action/trigger.rb:56:in `fire_triggers'
    from /home/pete/.vagrant.d/gems/gems/vagrant-triggers-0.4.3/lib/vagrant-triggers/action/trigger.rb:18:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:69:in `block in run'
    from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:69:in `run'
    from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:147:in `action'
    from /usr/share/vagrant/plugins/commands/destroy/command.rb:28:in `block in execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:193:in `block in with_target_vms'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:191:in `each'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:191:in `with_target_vms'
    from /usr/share/vagrant/plugins/commands/destroy/command.rb:27:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:38:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:484:in `cli'
    from /usr/bin/vagrant:127:in `<main>'

I've tried a number of different run commands, but I currently have it set to simple 'ls' as I figured it was about as simple as it gets.

config.trigger.before :destroy do
  info "running trigger code"
  run "ls"
end

Sorry if this isn't the correct way to inform you of a bug. Also sorry if this is simply something I'm doing wrong.

Cheers, Pete

emyl commented 9 years ago

Hello,

Thanks for reporting the issue. Unfortunately I wasn't able to reproduce the problem.

Please, could you tell me which is your host OS and which vagrant version you're running?

CreativeOutbreak commented 9 years ago

I've just tested it on my work machine, and don't have any problems... I'll check all the config on my home computer and send it across to you if I can't resolve the problem myself. Cheers, Pete

drcraig commented 9 years ago

I've hit the exact same issue. I was able to reproduce it using 0.4.3 of vagrant-triggers, but it does not occur on 0.4.2. We're using OpenStack as the provider via vagrant-openstack-plugin (0.3.1).

emyl commented 9 years ago

@drcraig thanks for the comment, please could you also let me know which is your host OS and vagrant version?

drcraig commented 9 years ago

@emyl Certainly. Sorry should have included that in the first note. Ubuntu 12.04 and Vagrant 1.3.5.

emyl commented 9 years ago

I've reproduced the issue. It should affect vagrant versions <= 1.4