Skip to content

Commit

Permalink
Merge branch 'backport-chef-13-support' into v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mthssdrbrg committed Apr 12, 2017
2 parents 40f0931 + 6aec051 commit 7a1b68c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ platforms:
driver_config:
provision_command:
- yum install -y tar java-1.7.0-openjdk
- curl -L https://chef.io/chef/install.sh | bash -s -- -v <%= ENV.fetch('CHEF_VERSION', '11.16.4') %>
- curl -L https://chef.io/chef/install.sh | bash -s -- -v <%= ENV.fetch('CHEF_VERSION', '12') %> -c <%= ENV.fetch('CHEF_CHANNEL', 'stable') %>
- name: debian-7.4
driver_config:
provision_command:
- apt-get install -y default-jre-headless net-tools
- curl -L https://chef.io/chef/install.sh | bash -s -- -v <%= ENV.fetch('CHEF_VERSION', '11.16.4') %>
- curl -L https://chef.io/chef/install.sh | bash -s -- -v <%= ENV.fetch('CHEF_VERSION', '12') %> -c <%= ENV.fetch('CHEF_CHANNEL', 'stable') %>
- name: ubuntu-14.04
driver_config:
provision_command:
- apt-get install -y default-jre-headless
- curl -L https://chef.io/chef/install.sh | bash -s -- -v <%= ENV.fetch('CHEF_VERSION', '11.16.4') %>
- curl -L https://chef.io/chef/install.sh | bash -s -- -v <%= ENV.fetch('CHEF_VERSION', '12') %> -c <%= ENV.fetch('CHEF_CHANNEL', 'stable') %>
suites:
- name: default
run_list:
Expand Down
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ env:
- KITCHEN_YAML=.kitchen.docker.yml
matrix:
- CHEF_VERSION=11 KAFKA_VERSION=0.8.1.1
- CHEF_VERSION=11 KAFKA_VERSION=0.8.1.1 KAFKA_CTRL_SHUTDOWN=true
- CHEF_VERSION=12 KAFKA_VERSION=0.10.1.1 SCALA_VERSION=2.11
- CHEF_VERSION=12 KAFKA_VERSION=0.8.1.1 KAFKA_CTRL_SHUTDOWN=true
- CHEF_VERSION=12 KAFKA_VERSION=0.10.2.0 SCALA_VERSION=2.11
- CHEF_VERSION=13 KAFKA_VERSION=0.10.2.0 SCALA_VERSION=2.11
- CHEF_VERSION=13 CHEF_CHANNEL=current KAFKA_VERSION=0.10.2.0 SCALA_VERSION=2.11
install: travis_wait bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
script: bundle exec kitchen test --destroy=always
matrix:
fast_finish: true
allow_failures:
- env: CHEF_VERSION=13 CHEF_CHANNEL=current KAFKA_VERSION=0.10.2.0 SCALA_VERSION=2.11
include:
- sudo: false
env: []
Expand Down
4 changes: 2 additions & 2 deletions libraries/log4j.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def render_appender(name, options)
end

def render_logger(name, options)
level_appender = options.values_at(:level, :appender).compact.join(', ')
level_appender = [options['level'], options['appender']].compact.join(', ')
definition = format('log4j.logger.%s=%s', name, level_appender)
content = [definition]
unless (additivity = options[:additivity]).nil?
unless (additivity = options['additivity']).nil?
content << %(log4j.additivity.#{name}=#{additivity})
end
content.join($/) << newline
Expand Down
6 changes: 3 additions & 3 deletions templates/default/log4j.properties.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Generated by Chef.
# Local modifications will be overwritten.

log4j.rootLogger=<%= @config.root_logger %>
log4j.rootLogger=<%= @config['root_logger'] %>

<% Array(@config[:appenders]).sort.each do |key, opts| %>
<% Array(@config['appenders']).sort.each do |key, opts| %>
<%= render_appender(key, opts) %>
<% end %>
<% Array(@config[:loggers]).sort.each do |key, opts| %>
<% Array(@config['loggers']).sort.each do |key, opts| %>
<%= render_logger(key, opts) %>
<% end %>

0 comments on commit 7a1b68c

Please sign in to comment.