Skip to content

Instantly share code, notes, and snippets.

@aespinosa
Created February 16, 2014 01:27
Show Gist options
  • Save aespinosa/9027913 to your computer and use it in GitHub Desktop.
Save aespinosa/9027913 to your computer and use it in GitHub Desktop.
windows_feature resources not compiling properly in a chefspec run.
aspnet_skeleton::default
================================================================================
Recipe Compile Error in /tmp/d20140216-3013-1to7s1t/aspnet_skeleton/recipes/default.rb
================================================================================
TypeError
---------
nil is not a symbol
Cookbook Trace:
---------------
/tmp/d20140216-3013-1to7s1t/windows/resources/feature.rb:30:in `initialize'
/tmp/d20140216-3013-1to7s1t/iis/recipes/default.rb:22:in `block in from_file'
/tmp/d20140216-3013-1to7s1t/iis/recipes/default.rb:21:in `each'
/tmp/d20140216-3013-1to7s1t/iis/recipes/default.rb:21:in `from_file'
/tmp/d20140216-3013-1to7s1t/aspnet_skeleton/recipes/default.rb:20:in `from_file'
Relevant File Content:
----------------------
/tmp/d20140216-3013-1to7s1t/windows/resources/feature.rb:
23: actions :install, :remove
24:
25: attribute :feature_name, :kind_of => String, :name_attribute => true
26:
27: def initialize(name, run_context=nil)
28: super
29: @action = :install
30>> @provider = lookup_provider_constant(locate_default_provider)
31: end
32:
33: private
34: def locate_default_provider
35: if ::File.exists?(locate_sysnative_cmd('dism.exe'))
36: :windows_feature_dism
37: elsif ::File.exists?(locate_sysnative_cmd('servermanagercmd.exe'))
38: :windows_feature_servermanagercmd
39: end
includes the iis recipe (FAILED - 1)
Failures:
1) aspnet_skeleton::default includes the iis recipe
Failure/Error: result = runner.converge described_recipe
TypeError:
nil is not a symbol
# /tmp/d20140216-3013-1to7s1t/windows/resources/feature.rb:30:in `initialize'
# /tmp/d20140216-3013-1to7s1t/iis/recipes/default.rb:22:in `block in from_file'
# /tmp/d20140216-3013-1to7s1t/iis/recipes/default.rb:21:in `each'
# /tmp/d20140216-3013-1to7s1t/iis/recipes/default.rb:21:in `from_file'
# /tmp/d20140216-3013-1to7s1t/aspnet_skeleton/recipes/default.rb:20:in `from_file'
# ./spec/default_spec.rb:13:in `block (2 levels) in <top (required)>'
Finished in 29.73 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/default_spec.rb:10 # aspnet_skeleton::default includes the iis recipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment