Sha256: cd923465b6c7f1edb0403ccdff178376e2c3f217d393811ca1532bde63a603d4

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 Bytes

Contents

require 'vagrant-openstack-provider/client/openstack'

module VagrantPlugins
  module Openstack
    module Command
      class AbstractCommand < Vagrant.plugin('2', :command)
        def initialize(argv, env)
          @env = env
          super(argv, env)
        end

        def execute(name)
          env = {}
          with_target_vms(nil, provider: :openstack) do |machine|
            env[:machine] = machine
            env[:ui] = @env.ui
          end

          VagrantPlugins::Openstack::Action::ConnectOpenstack.new(nil, env).call(env)

          cmd(name, @argv, env)
          @env.ui.info('')
        end

        def cmd(_name, _argv, _env)
          fail 'Command not implemented. \'cmd\' method must be overridden in all subclasses'
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-openstack-provider-0.4.1 lib/vagrant-openstack-provider/command/abstract_command.rb
vagrant-openstack-provider-0.4.0 lib/vagrant-openstack-provider/command/abstract_command.rb
vagrant-openstack-provider-0.3.4.pre lib/vagrant-openstack-provider/command/abstract_command.rb
vagrant-openstack-provider-0.3.3 lib/vagrant-openstack-provider/command/abstract_command.rb
vagrant-openstack-provider-0.3.2 lib/vagrant-openstack-provider/command/abstract_command.rb
vagrant-openstack-provider-0.3.0 lib/vagrant-openstack-provider/command/abstract_command.rb