Skip to content

Commit

Permalink
Replace -toolLocations with --toolLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Cadelina committed Sep 21, 2015
1 parent 031197f commit 60dd474
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions spec/classes/jenkins_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
let(:params) { {:enable => false, :ensure => 'stopped' } }
it { should contain_service('jenkins-slave').with(:enable => false, :ensure => 'stopped') }
end

describe 'with tool_locations' do
let(:params) { { :tool_locations => 'System-CPython-2.7:/usr/bin/python2.7' } }
it { should contain_file(slave_runtime_file).with_content(/--toolLocation System-CPython-2.7:\/usr\/bin\/python2.7/) }
end
end

shared_examples 'using slave_name' do
Expand Down
11 changes: 6 additions & 5 deletions templates/jenkins-slave-defaults.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ CLIENT_NAME="<%= @slave_name -%>"

FSROOT="<%= @slave_home -%>"

TOOL_LOCATIONS="<%= @tool_locations -%>"

DESCRIPTION="<%= @description -%>"

# credentials
Expand Down Expand Up @@ -80,9 +78,12 @@ if [ -n "$FSROOT" ]; then
FSROOT_ARG="-fsroot '$FSROOT'"
fi

if [ -n "$TOOL_LOCATIONS" ]; then
TOOL_LOCATIONS_ARG="-toolLocations '$TOOL_LOCATIONS'"
fi
<% if @tool_locations %>
TOOL_LOCATIONS_ARG=""
<% @tool_locations.split.each do |tool_location| %>
TOOL_LOCATIONS_ARG='$TOOL_LOCATIONS_ARG --toolLocation <%= tool_location -%>'
<% end %>
<% end %>

if [ -n "$DESCRIPTION" ]; then
DESCRIPTION_ARG="-description '$DESCRIPTION'"
Expand Down

0 comments on commit 60dd474

Please sign in to comment.