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

Passing an array of strings to the vm argument does not work #30

Closed tonnydourado closed 9 years ago

tonnydourado commented 9 years ago

The documentation states that the :vm parameter can be a string, a regex, or an array of strings and/or regex, but when I pass an array of strings, I get this error:

/home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:42:in `match': type mismatch: String given (TypeError)
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:42:in `block (3 levels) in fire_triggers'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:41:in `each'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:41:in `block (2 levels) in fire_triggers'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:35:in `each'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:35:in `block in fire_triggers'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:34:in `tap'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:34:in `fire_triggers'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:16:in `call'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:17:in `call'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
        from /home/antonio/.vagrant.d/gems/gems/vagrant-triggers-0.4.2/lib/vagrant-triggers/action/trigger.rb:17:in `call'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/warden.rb:34:in `call'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/builder.rb:116:in `call'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:66:in `block in run'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/util/busy.rb:19:in `busy'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runner.rb:66:in `run'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:196:in `action_raw'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:173:in `block in action'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:474:in `lock'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:161:in `call'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:161:in `action'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/destroy/command.rb:31:in `block in execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:220:in `each'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/destroy/command.rb:30:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/cli.rb:42:in `execute'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:292:in `cli'
        from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant:174:in `<main>'

If I pass a regex that matches the same strings I passed, it works.