Class: VagrantPuppetconf::Command::Puppetenv
- Inherits:
-
Vagrant::Command::Base
- Object
- Vagrant::Command::Base
- VagrantPuppetconf::Command::Puppetenv
- Defined in:
- lib/vagrant-puppetconf/command/puppetenv.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant-puppetconf/command/puppetenv.rb', line 17 def execute @ui = Vagrant::UI::Colored.new('puppetconf') = {} argv = OptionParser.new args = split_main_and_subcommand argv vms = args[0] [:environment] = args[1] validate with_target_vms(vms) do |vm| Updater.update(vm, @ui, {'main/environment' => [:environment]}) end end |
#validate(options) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/vagrant-puppetconf/command/puppetenv.rb', line 7 def validate() %w{environment}.each do |opt| if [opt.to_sym].nil? || [opt.to_sym].empty? @ui.error "#{opt.upcase} not set" @ui.info "Usage: vagrant [vm-name] puppetenv #{I18n.t('vagrant.plugins.puppetconf.command.options.environment')}" exit 1 end end end |