Class: VagrantPlugins::DataBags::Action::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-databags/action/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
# File 'lib/vagrant-databags/action/base.rb', line 7

def initialize(app, env)
  @app = app

  klass = self.class.name.downcase.split('::').last
  @logger = Log4r::Logger.new("vagrant::databags::#{klass}")
end

Instance Method Details

#chef_provisioner_type(chef) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/vagrant-databags/action/base.rb', line 25

def chef_provisioner_type(chef)
  if chef.respond_to? :type
    provisioner_type = chef.type.to_sym
  else
    provisioner_type = chef.name.to_sym
  end
  provisioner_type
end

#machine_chef_provisioners(machine) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/vagrant-databags/action/base.rb', line 14

def machine_chef_provisioners(machine)
  machine.config.vm.provisioners.select do |provisioner|
    # Vagrant 1.7 changes provisioner.name to provisioner.type
    if provisioner.respond_to? :type
      provisioner.type.to_sym == :chef_solo || provisioner.type.to_sym == :chef_zero
    else
      provisioner.name.to_sym == :chef_solo || provisioner.name.to_sym == :chef_zero
    end
  end
end