chef-boneyard/omnibus

omnibus_build: can't modify frozen Hash

Closed this issue · 1 comments

Cookbook version

5.2.0

Chef-client version

13.1.31

Platform Details

CentOS/RHEL 7.3

Scenario:

Converge the omnibus build node using the following recipe:

include_recipe 'omnibus::default'

omnibus_build 'myproj' do
  project_dir node['omnibus']['build_dir']
  log_level :internal
end

Actual Result:

Recipe: omnibus-myproj::build_package
  * omnibus_build[myproj] action execute
  Recipe: <Dynamically Defined Resource>
    * directory[/var/cache/omnibus/build/myproj/*.manifest] action delete (up to date)
    * directory[/var/cache/omnibus/pkg] action delete (up to date)
    * directory[/home/vagrant/omnibus-apica/pkg] action delete (up to date)
    * directory[/opt/myproj] action delete
      - delete existing directory /opt/myproj
    * directory[/var/cache/omnibus] action create (up to date)
    * directory[/opt/myproj] action create
      - create new directory /opt/myproj
      - change owner from '' to 'vagrant'
      - restore selinux security context

    ================================================================================
    Error executing action `execute` on resource 'omnibus_build[myproj]'
    ================================================================================

    RuntimeError
    ------------
    can't modify frozen Hash

    Cookbook Trace:
    ---------------
    /tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:153:in `environment'
    /tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:144:in `execute_with_omnibus_toolchain'
    /tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:77:in `block (2 levels) in <class:OmnibusBuild>'
    /tmp/kitchen/cache/cookbooks/omnibus/libraries/omnibus_build.rb:74:in `block in <class:OmnibusBuild>'

    Resource Declaration:
    ---------------------
    # In /tmp/kitchen/cache/cookbooks/omnibus-myproj/recipes/build_package.rb

      7: omnibus_build 'myproj' do
      8:   project_dir node['omnibus']['build_dir']
      9:   log_level :internal
     10: end

    Compiled Resource:
    ------------------
    # Declared in /tmp/kitchen/cache/cookbooks/omnibus-myproj/recipes/build_package.rb:7:in `from_file'

    omnibus_build("myproj") do
      action [:execute]
      default_guard_interpreter :default
      declared_type :omnibus_build
      cookbook_name "omnibus-myproj"
      recipe_name "build_package"
      project_dir "/home/vagrant/omnibus-apica"
      log_level :internal
      base_dir "/var/cache/omnibus"
      project_name "myproj"
      install_dir "/opt/myproj"
      config_file "/home/vagrant/omnibus-apica/omnibus.rb"
    end

    System Info:
    ------------
    chef_version=13.1.31
    platform=centos
    platform_version=7.3.1611
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-client worker: ppid=10230;start=10:43:49;
    executable=/opt/chef/bin/chef-client

Looks like Chef 13 doesn't like this:

      environment = new_resource.environment || {}
      # Ensure we inheriet the calling procceses $PATH
      environment['PATH'] = ENV['PATH']