Class: PoiseBoiler::Helpers::Kitchen::PolicyProvisioner

Inherits:
Kitchen::Provisioner::PolicyfileZero
  • Object
show all
Includes:
ProvisionerHelpers
Defined in:
lib/poise_boiler/helpers/kitchen/policy_provisioner.rb

Overview

Since:

  • 1.7.0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nameObject

Override the default value from the base class. default_config :policyfile, ‘.kitchen/poise_policy.rb’ expand_path_for :policyfile

Since:

  • 1.7.0



36
37
38
# File 'lib/poise_boiler/helpers/kitchen/policy_provisioner.rb', line 36

def self.name
  'PoisePolicyfileZero'
end

Instance Method Details

#create_sandboxObject

Run our policy generation first.

Since:

  • 1.7.0



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/poise_boiler/helpers/kitchen/policy_provisioner.rb', line 41

def create_sandbox
  policy_base = File.join(config[:kitchen_root], '.kitchen', 'poise_policy')
  # Copy all my halite-y stuff to a folder. This should probably use a
  # temp dir instead.
  FileUtils.rm_rf(policy_base)
  convert_halite_cookbooks(policy_base) unless poise_helper_instance.options['no_gem']
  copy_test_cookbook(policy_base)
  copy_test_cookbooks(policy_base)
  # Generate a modified policy to use the cookbooks we just made.
  policy_path = generate_poise_policy(policy_base)
  # Compile that policy because the base provider doesn't do that.
  compile_poise_policy(policy_path)
  # Tell the base provider code to use our new policy instead.
  config[:policyfile] = policy_path
  super
end