Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fix apache listen ports attribute #148

Merged
merged 1 commit into from
Apr 23, 2016
Merged

Conversation

legal90
Copy link
Contributor

@legal90 legal90 commented Apr 19, 2016

In cookbook apache2 v3.2.0 the attribute was changed and renamed:
node.default['apache']['listen_ports'] -> node.default['apache']['listen']

This change causes the following error with apache2 cookbook 3.2.0 and higher:

         NoMethodError
         -------------
         undefined method `include?' for nil:NilClass

         Cookbook Trace:
         ---------------
           /tmp/kitchen/cache/cookbooks/stash/recipes/apache2.rb:1:in `from_file'
           /tmp/kitchen/cache/cookbooks/stash/recipes/default.rb:16:in `from_file'

         Relevant File Content:
         ----------------------
         /tmp/kitchen/cache/cookbooks/stash/recipes/apache2.rb:

           1>> node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['port']] unless node['apache']['listen_ports'].include?(node['stash']['apache2']['port'])
           2:  node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['ssl']['port']] unless node['apache']['listen_ports'].include?(node['stash']['apache2']['ssl']['port'])

This PR fixes that issue.

@atikhono
Copy link
Contributor

+1

In cookbook apache2 v3.2.0 the attribute was changed and renamed:
`node.default['apache']['listen_ports']` -> `node.default['apache']['listen']`
@bflad
Copy link
Owner

bflad commented Apr 19, 2016

Would a begin...rescue block here allow supporting both and not require the dependency version pinning?

@linc01n linc01n merged commit 0742842 into bflad:master Apr 23, 2016
@linc01n linc01n added the fix label Apr 25, 2016
@legal90 legal90 deleted the fix-apache2 branch May 5, 2016 08:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants